HISE Logo Forum
    • Categories
    • Register
    • Login

    How do I get the area of a panel?

    Scheduled Pinned Locked Moved Scripting
    3 Posts 2 Posters 81 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

      Rather noob question, but how do I get the area from a panel in my GUI?
      I just to set some positions of objects inside the panel from its area.

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

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

        @VirtualVirgin

        If you're within the paint routine of the panel you can use this.getLocalBounds(0);

        If you're in some other part of your script you can use myPanel.get("x") - replace "x" with "y", "width", "height", etc. - This will give you the position relative to its parent component.

        If you need the global position you can use myPanel.getGlobalPositionX(); or myPanel.getGlobalPositionY();

        If you type "panel" into the API search in HISE you will see all of the functions that are available for panels.

        a83e286b-3db7-4c34-90a2-2e060cb7db90-image.png

        Libre Wave - Freedom respecting instruments and effects
        My Patreon - HISE tutorials
        YouTube Channel - Public HISE tutorials

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

          @d-healey Thank you! You are always so helpful!

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

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

          25

          Online

          1.8k

          Users

          12.0k

          Topics

          104.7k

          Posts