Use Sketchup default cursors
-
@thomthom said:
Do SU use
.cur
files? Isn't it just.png
?Yes your right Thom, I boo-boo'd. Posted before I tested.
SU does NOT recognize
****.cur****
files. If you try it the id for the cursor = 0. (I'm once again flabbergasted at whomever wrote the SU ruby API. They've earned 20 lashes with a Nerf-Noodle!)The API states 'image' but does not say what formats are acceptable.
I've already begun extracting the 4 images files from the cursor files, decided to do a bit of anti-aliasing work on the edges of the pencils.
DONE (Original posting now has updated zip with png images for SU cursors and buttons.)Get them...
Will also look at the Windows API and see if I can cobble up a system call to load a cursor file instead of making a call to UI.create_cursor, as UI.set_cursor should not care how the cursor got loaded into memory, it only wants a pointer (id). [Some testing has shown the UI.set_cursor canNOT deal with Windows Cursor resources, so a 'special' set_win_cursor method would be needed, using a direct Win32 API call.]
-
@thomthom said:
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/ui.html#create_cursor
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/ui.html#set_cursor
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/tool.html#onSetCursorThese links you give me 404 errors . I know I've read about this somewhere else recently but can't remember where now.
EDIT:
It might have been from when I read in TT lib the other day to understand how the win32api works. Found this page now: https://bitbucket.org/thomthom/tt-library-2/src/9ff3a5f08604ed477eb4b17fd63612bfc42832dd/TT_Lib2/cursor.rb?at=Version%202.9
-
Advertisement