I see the following code to use a ‘built in’ SketchUp cursor:
# Here we have hard coded a special ID for the pencil cursor in SketchUp.
# Normally you would use `UI.create_cursor(cursor_path, 0, 0)` instead
# with your own custom cursor bitmap:
#
# CURSOR_PENCIL = UI.create_cursor(cursor_path, 0, 0)
CURSOR_PENCIL = 632
def onSetCursor
# Note that `onSetCursor` is called frequently so you should not do much
# work here. At most you switch between different cursor representing
# the state of the tool.
UI.set_cursor(CURSOR_PENCIL)
end
Taken from this example:
I’m wondering if there is a list of values for other SketchUp cursors (specifically the move tool cursor), and if they are ‘safe’ to use in an extension.
I also noticed that using UI.create_cursor the cursor does not scale correctly on Windows 10 with one monitor (4K) set to 175%, and another monitor set to 100%. The build in cursors scale correctly as does the CURSOR_PENCIL = 632
I’m not sure what would happen if you passed one of these to UI.create_cursor, but I would guess that you’d get a new cursor that just happens to use the same file as the built-in.
I don’t know where the corresponding svg images are kept on Windows.
If there is a reference for the built-in cursor_id values, I don’t know it.
SketchUp only supports up to 150% display scaling (aka scaled resolution on Mac.)
But with regard to cursors and toolbar buttons, the image must be a vector SVG (or PDF on Mac,) in order to be correctly and precisely scaled. (Raster image formats can get blurry.)
Last cycle I sent in a request to support 4K (200%) and 5K (266%) displays. (I think it is past time.)
…
I remember starting a topic on this subject. An I think at one time I had a list of all the cursor IDs.
I’ll see if I can find it.
Sure, until they change.
Since they are undocumented, they’d be subject to change at anytime, without notice.
(I also don’t know if their use would pass the EW review.)
BTW: Be careful with the integers in set_cursor, I don’t remember exactly which one but that caused a bugsplat crash… when I did the same trials not recently.
I didn’t find the topic over at SketchUcation. And I don’t know where that old list is.
I did recreate a bit of the first step I did before. Which was to export (a few) PNG resource images from an old SketchUp executable using Visual Studio. They have the resource id as part of the image filename.
It’s tedious, and once they’ve all been exported compiling the list is a manual job.
As I had said, I cannot find the list I had long ago created.
You can find the cursor IDs by using the attached tool. You see the cursors by scrolling the mouse wheel up and jiggling the mouse. The IDs start at 629 (for the 2 Point Arc tool.)