HISE Logo Forum
    • Categories
    • Register
    • Login

    How can I make a panel with diagonal "click zones"?

    Scheduled Pinned Locked Moved Scripting
    7 Posts 4 Posters 159 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 VirtualVirgin

      I made some diagonal text using panels which is done using rotation.
      Rotation does not actually rotate the panel though, it rotates the graphics "canvas", so the panels are still on right angles.

      Screenshot 2024-12-22 at 12.38.57 PM.png

      I want to make "click zones" for each text strip area, but the way the panels overlap, they are only leave vertical zones:

      Screenshot 2024-12-22 at 12.39.32 PM.png

      So the click zone associated with each text strip is not good this way.

      I would like to use an invisible panel overlay to get the clicks.

      Screenshot 2024-12-22 at 2.09.10 PM.png

      How can I use a mouse callback to separate the area diagonally to make "click zones" for each strip?

      The purpose here is to open a panel to change the text for each slot:
      Screenshot 2024-12-22 at 3.22.18 PM.png

      Screenshot 2024-12-22 at 3.22.23 PM.png

      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 There is no built in way to do this. You'd need to use some maths (trigonometry) to create the click zones in the mouse callback.

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

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

          @d-healey Thanks David :)

          I have another question about using the label:

          When I double-click I make the panel and label visible to change the text like the above picture.
          When I enter text I have the control callback for the label set:

          inline function onLabelControl(component, value)
          {
          	local index = matrix0LabelArray.indexOf(component);
          
          	if (component)
          	{
          	component.set("visible", false);
          	matrix0LabelPanelArray[index].set("visible", false);
          	matrix0PanelArray[index].set("visible", true);
          	matrix0PanelArray[index].set("text", component.get("text"));
          	matrix0PanelArray[index].repaint();
          	Console.print("onLabelControl callback has been exectued");
          	}
          };
          

          That hides the label for text entry and makes the panel with the diagonal text visible.

          I am trying to help the behaviour though.
          It only works if I enter a new text.
          If keep the same text and hit "enter", or I hit "esc" or I click somewhere else, the callback is not executed so the label for text entry just remains visible.
          How can I make it execute when those other things happen?
          Can I detect a mouse click off of the label, or when the "esc" key is used?

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

          d.healeyD ustkU 2 Replies Last reply Reply Quote 0
          • d.healeyD
            d.healey @VirtualVirgin
            last edited by

            @VirtualVirgin said in How can I make a panel with diagonal "click zones"?:

            if (component)

            When will this ever not be true?

            @VirtualVirgin said in How can I make a panel with diagonal "click zones"?:

            How can I make it execute when those other things happen?

            See if enabling the updateEachKey property works.

            @VirtualVirgin said in How can I make a panel with diagonal "click zones"?:

            Can I detect a mouse click off of the label, or when the "esc" key is used?

            You can use setKeyPressCallback() with most controls, I think that includes labels. This also triggers based on focus changes.

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

            1 Reply Last reply Reply Quote 1
            • ustkU
              ustk @VirtualVirgin
              last edited by

              @VirtualVirgin @d-healey No need for trigo! Assuming a 45° angle...

              HiseSnippet 1030.3ocsV0taaaCEkxIZKVXcaEsO.D8WxMYp9q5jrrflFGmUiU6ZL21r8q.ZIJKBKQZPQEWig7NrGq83r2fsKkjijSxxFLVMfMz8KxiN7buzijBWZbrPhLrd+x4TjwWYNdIWEzMfv3n9mgL9ZyAjXEUhybc5x4j3XpGxvXqeT6vn51nzO+4qNkDR3tzBWHzGELW5aYQLUg2Qm7SrvvyIdz2yhJkc6S56J3cEghD.OaYVGMm3NiLkNjnSqhI5Mj3.jwyMq+xNT59s787HsZ40oSmCO3v1G1f3WuMYRiNG1tY68adv99HiunmGSIjiUDEMFVzSEdKGGHVvy1fOxhYSBoZiFnwvNm4F0MfE5MZE4DiPFaOpfp1Jipdp4.lG6F+ET12lF.WTQYRynxCAoFkgT8GFRFkfz1YP5wlickr4phHZ77jbuEHpwZPJKJpxNaY1UvUTtxIhLidtDL5C1RehK0tS856ggepgOxBRKVDRcbCoDocsirrfStXE9JhDOhvogMvGiWsVSopthn4BNXX+rrvOa8Zt.RuU8iJ4Y3oWNn2vO.96.YlUjSLUMBHY0OKRTLN01Og6pXBt8zZV+lU0oN9fv50gg1YhnXmEALEE1ppVU8ERrM635GgY+P9hCOt6t0rpBkB0FqgotLaU.K1winHNQTdB93iwL7qvqVSOhblj5g+9a7LIDzo5cAVEOIYwa0X6hmyv6hu3EM2Cm8X5pBbwanroAJ6Zqhda+6gAdtYCm55U7Zqq0LUIBXfHIl1kDFNA1zBFfdEvtorfl8VB71c1uuCmljyxT931uj3ADUfiTjv8ryVMmOAkrD9BvrF9E3KxHRlONOtaHycF0CXvpqDDykvwysHvZE6mjNWe9oULv60JviE7gBE8cb6zW.qqsv2Nju+8FSKwjhvPp7dCqmuHenBs4IQSnx8.IWXB8lDg9o0aRM+maRKO2vMSwWJQAuOmod2bZt8caiQ4sIvSen+Y.mo6ry8A4MmJULMDLNidELKMqOup4Yz3YJw7zby6sPFeoJM5iVMEPKZPLnGeGyLAD5SEia+0SVV1XAySACWMM9cCDJHUyns9CHHH1DKVI4.n7MlPOFtvA5tChfQfBujPhZ84h5aLxC.mCqMDROngGyTKKeix+aCK+uBwGaNhobCteLV4dvHbZ84.i4Ww7Hyd99TWUA.2177e4yy8InropSg4.RFnSLGlDMFlu4RgcmCpGcefQEshMytt1Vy.iobuTi+B9jGrg11HOXiUAQQDWo3R2rtO8kX6j5AvDO8R9pv+1.rwMPocjk44H3N0KccWeotSgM2zBasoE1dSK7kaZgc1zB2eSK7f+8B0+kmWmnDQYsMHzfQ8RGmYXziS.EXpZE82TYi6OC
              

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

              d.healeyD ulrikU 2 Replies Last reply Reply Quote 5
              • d.healeyD
                d.healey @ustk
                last edited by

                @ustk Ooh that's really elegant, maybe one for the snippet browser or the docs.

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

                1 Reply Last reply Reply Quote 0
                • ulrikU
                  ulrik @ustk
                  last edited by

                  @ustk Nice done!

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

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

                  26

                  Online

                  1.8k

                  Users

                  12.0k

                  Topics

                  104.5k

                  Posts