HISE Logo Forum
    • Categories
    • Register
    • Login

    Issue with .getLocalBounds() ?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 261 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.
    • VirtualVirginV
      VirtualVirgin
      last edited by

      I'm having a strange issue where .getLocalBounds() is returning "0" for x when the component is clearly not located at x 0.

      Here the panel is located at x 100:
      Screenshot 2025-04-01 at 7.03.45 PM.png

      And here I get the local bounds and print:
      Screenshot 2025-04-01 at 6.59.32 PM.png

      And the console says x is 0:
      Screenshot 2025-04-01 at 6.59.08 PM.png

      Any ideas on how that would be?
      There is nothing changing the x position in the script and on compile the panel is located at x 100.

      You can listen to my orchestral mockups here:
      https://www.virtualvirgin.net/

      1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey
        last edited by d.healey

        getLocalBounds will always return 0 for the x and y because it's the "local" bounds, not the global position on the UI.

        You either want .get("x") or .getGlobalPositionX() depending on what you need.

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        VirtualVirginV 1 Reply Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @d.healey
          last edited by

          @d-healey Thanks. I thought "getLocalBounds()" would get the x and y from the parent component x and y , not the global x.

          You can listen to my orchestral mockups here:
          https://www.virtualvirgin.net/

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

          21

          Online

          2.0k

          Users

          12.7k

          Topics

          110.1k

          Posts