Hide Cursor Help
-
Hi,
For the game I am making I want the cursor to not be visible while playing. I tryed using a transparent png file to use as a cursor but I can't make it work.
cursor_id = nil cursor_path = Sketchup.find_support_file("Pointer.png", "Plugins/") if cursor_path cursor_id = UI.create_cursor(cursor_path, 0, 0) end def onSetCursor puts "onSetCursor; view = " + view.to_s UI.set_cursor(cursor_id) end
If there is the possibility to set the position of the cursor off screen that will be even better than using a transparent png.
Again thanks and remember I am not that good but will try my best understanding you suggestions.
-
you could try a 1px x 1px cursor?
john -
Been searching and can't find a way to do this...Can u provide simple example?
Also found that in order to move the cursor with script I need to use WINAPI..here is example: http://msdn.microsoft.com/en-us/library/ms648394%28VS.85%29.aspx
Only problem the code there is C++ 0_0
Anyways thanks for help.
-
just did a test and the 1x1 didn't work, however
I copied and renamed a working cursor in another plugin [ae_wiretool], then in an editor I 'cut' the image content out of the png file, now when run in SU I have no cursor...
john
-
@Rafael: ALL of the code in your first post MUST be within a custom Tool, otherwise
onSetCursor()
will never be called by the application engine.Also do not put string output calls within
UI
callbacks, because this will slow down SketchUp in a MAJOR way. -
Thank you Driven & Dan Rathbun I solved it thanks to you guys!
Note: loading my plugin as tool solved another problem without me trying and that is when you are playing the game before you could click & drag mouse and select objects which was bad but now its all fixed!
Advertisement