HISE Logo Forum
    • Categories
    • Register
    • Login

    Absolute X/Y for mouse?

    Scheduled Pinned Locked Moved Scripting
    4 Posts 3 Posters 165 Views
    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.
    • Dan KorneffD
      Dan Korneff
      last edited by

      I feel like I've been here before but can't find anything in the search.
      Is there a way to get the absolute position of the mouse on the front interface? When a component has a parent, the result of event.x / event.y is always relative to the parent, and if the parent has a parent it gets a little more complicated.
      I'm writing a script that traverses the parents, stores their X/Y positions and then adds them all up but it's starting to get a bit convoluted.

      Dan Korneff - Producer / Mixer / Audio Nerd

      A 1 Reply Last reply Reply Quote 0
      • A
        aaronventure @Dan Korneff
        last edited by

        @Dan-Korneff each component has a getGlobalPositionX and Y methods, and you can use in addition to the event.x and y to get the global position of the mouse.

        Dan KorneffD 1 Reply Last reply Reply Quote 0
        • Dan KorneffD
          Dan Korneff @aaronventure
          last edited by

          @aaronventure 🤗

          Dan Korneff - Producer / Mixer / Audio Nerd

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @Dan Korneff
            last edited by ustk

            @Dan-Korneff If they are real components then @aaronventure is right, but if they are child panels (from addChildPanel()) then I reckon having an issue not getting the right global position

            Can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            41

            Online

            1.8k

            Users

            12.0k

            Topics

            104.1k

            Posts