sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    โš ๏ธ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Hide Cursor Help

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 3 Posters 628 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • renderizaR Offline
      renderiza
      last edited by

      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.

      [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        you could try a 1px x 1px cursor?
        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • renderizaR Offline
          renderiza
          last edited by

          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.

          [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            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

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              @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.

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • renderizaR Offline
                renderiza
                last edited by

                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!

                [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement