I’m looking for a great tutorial for creating a new cursor in Ruby.
To create Icon I try to use Layout then export as pdf for mac and convert it into svg with online service.
But it didn’t work
I was suspecting the size of the pdf 72x72.[icons.zip|attachment]
After I try an online service to create and svg and convert it into pdf with another online service
the dimension of the pdf is now 24x24
But it didn’t work.
please find enclosed the all theicons.zip (61,5 Ko) file
So as alway , I use the same bad method that I always use with 64x64 png where I change the hot point depending of the platform ( mac or pc)
Please find enclosed fin actual code that work but not with svg or pdf (only png)
class SimpleMoveTool
###################
###################
##### ICON #####
###################
###################
if(RUBY_PLATFORM =~ /darwin/)
middle_cursor_point = 45
#iConeDeLoutil = "move_copy.pdf"
else
middle_cursor_point = 22
#iConeDeLoutil = "move_copy.svg"
end
extension_dir = __dir__.dup
extension_dir.force_encoding('UTF-8') if extension_dir.respond_to?(:force_encoding)
cursorDir = File.join(extension_dir, "..", "icon")
iConeDeLoutil = "move_yes.png"
cursor_path = File.join(cursorDir, iConeDeLoutil)
CURSOR_ID = UI.create_cursor(cursor_path, middle_cursor_point, middle_cursor_point) if File.exist?(cursor_path)
def initialize
.......
@current_cursor = C URSOR_ID
end
def onSetCursor
UI.set_cursor(@current_cursor)
end
Don’t worry about file name (there is 3 icons )
I 'm looking an complete explanation about cursor inruby. Thanks for your help