HISE Logo Forum
    • Categories
    • Register
    • Login

    Arc slider

    Scheduled Pinned Locked Moved General Questions
    23 Posts 5 Posters 720 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.
    • ustkU
      ustk @udalilprofile
      last edited by

      @udalilprofile
      As @DabDab said, definitely drop the globalLAF for a Content.createLocalLookAndFeel()

      assign as many knobs as you need to the LAF like so Knob1.setLocalLookAndFeel(laf)

      You have a condition in the LAF that requires the button to have its text set to GlowingArc so just don't forget that in other knobs or they will jus be transparent

      Some advices:

      • instead of using value, min, max and compute your range, you can just use obj.valueNormalized which will always be a 0 to 1 value and made exactly for this kind of job.

      • Also, this:

      g.setColour(obj.textColour);
      g.drawPath(K, pathArea, stableSize * arcThickness );
      
      if (obj.hover || obj.clicked)
      {
      	g.setColour(Colours.withAlpha(0xFF009768, 12.00 ));
      	g.drawPath(K, pathArea, stableSize * arcThickness );
      }
      

      just simplifies to:

      // I dropped the alpha as 12.0 is equal to 1.0 (alpha is a 0-1 value)
      g.setColour((obj.hover || obj.clicked) ? 0xFF009768 : obj.textColour);
      g.drawPath(K, pathArea, stableSize * arcThickness );
      
      • Instead of using panels on top of the knob, the circle and shadow can be handled by the LAF as well. You don't need extra components for that.

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

      U 1 Reply Last reply Reply Quote 0
      • U
        udalilprofile @ulrik
        last edited by

        @ulrik Thank you very much for your help. And especially for the snippet.) Can you show an example of a gradient?

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

          @ustk Thanks for the tips. I followed your advice.)))

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

            @udalilprofile Gradient fill:

            HiseSnippet 879.3ocsUstaSCCE1tqAwJLDHwCPD+JEMFIaktMMgXzaPErsJJ2jPHjahSi0Rrirc1nBwKG+hGGdCfiSZWZgxXpRDU0jysb9x47cNdfT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help pressing F5 in the forum...

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

              @udalilprofile as @ustk already showed you, but you can also make circular gradients with several colours, see this example

              g.setGradientFill([Colours.green , a[2], a[3], Colours.red, 0, 0, false, Colours.white, 0.5]);
              

              the "false" statement means "linear" gradient, "true" will set the gradient to "circular gradient"
              and you can add more colours (both for linear and circular versions)

              see the docs here:
              https://docs.hise.audio/scripting/scripting-api/graphics/index.html#setgradientfill

              Skärmavbild 2024-12-18 kl. 18.17.58.png

              HiseSnippet 1148.3ocsWstSibCE1CvTsSZQpqTe.FE0eLTgfbiPZQUMK21h5BaDY6pJgVsqiGOYbwwNx1CPTER8QouF8spuAsGOSByD1DtjBiPg3yEe9NG646bRGkjP0ZoB4T5ciFRQNeka2QBS7dwXl.cz9HmUcesBGxnBi1uFZ2QCwZMMD43r7qsl33sBJ84e9ocwbrfPyEgPuWxHz2vFvL4R6z9WXb9g3P56XCJXci1GQjh8jbYB.mkcqfFhImi6SOAaMaIWzOi0wHmuyMrZipQsH3lsp1nFgTq01099sITbTDsY0s1tQqnFQXRkZHmu3fPlQp5ZvFpF4rxtxvQcikWJxBv6YZVON0tnJpKD4LwGJ4g1TzJEsWLiG1YRcRifcoSdUa4rp123dLKjci77p2WmpvO2ihEPmklFdKOE7pVDdUJ.uY.ImBPZkLH8R2tDEanIWiEOeo6QBCUAkG5TPIyVzR+sq6dRvBgYiA3yoGpfE23QPyJUV2G9XscJUBNqzF+NXAkq8+Q+Id0mZdEmumbvPovdmInbpIkK3xof4QIBhgIEA8WqzeTx6BrxGChMwLscKdijf46JSDg5.az75uQDboA14fxUtJJpd5icS8J4oujYHw9ASbNnLKr7ZqUxC1XOBVS8yvP0x+f2la5yYBJDt9iuUC1.6tlZlbM+PHPAmkcOTuAIFqLJZhlttekz+lnQpvh9TEMbce7Y09f8y5vmQXtl9AKx775on3y2YZTTalnvGxgXenj4Suxnv9jzfbOXquhRE9SG9I5RwUFfSQTtlKiYFaxrwV2AJqmhROBSQ3I7Gd4pGOglAnMqkAI6+mAnLpj6pJ0XdwegJTOJTc6S36qTs0cbfZhginoPp948Lsdtrdbf9LE74xR2cqrsuiDpYVBYq8ynz+3SoQTNWd4+q5eAqm5Exh4FQpDQPfnpri6Jaz5VI40V1hLljC3b1PMM.CVbMPMEIU9AC8YhwLZ.6wPaF0AHxMmJSLvoaPmSWamIDWvUvSjF5aEAoDXkttj+sUEEMScVlRkjyopYp11TTcWNFHRFzipV2+BLjm2XHP7Oc2D242MoXyNRFwcACkhiDLyaGREyqEHZLaO7se8n8wFrsEzXYfcCoJCyBAm8oW.C.j0Pxycep9bibHzV9l9Cv2MoZWcR6Ja4GwflRuvMi0Fc0MyH7mm0dT9.Cea6KYgl3bsQsior9wlhRPOhPUqPn9j9YMT0mWV092epCUi4kUO8gZq4kU+0nm5P0bdY0CLTe9.SvnZxPfvyL87a1obGq.dMbpglrCFIzLynhSA+jMT2CEhuzsic9mYiwklAFgWVeNv33QgW08.XNbhIGfq3d3u87L2KJiYt+wXihA2GbOIYPWnY.gBQWX4wAYNKYIrxVWwt1VA5REgoK9W3Yrxp10NiUVchRz.LQI+HIi70Nr8KRk.XRj9CS7bO1t1uJJkPtXcd.L6+GIjo2pOywZKpi0WTGarnNt0h5XyE0wsWTGac+NZ+oYuJwHGj8ZCBcbmCR6l43bf.C2.Sush9O7n+0vA
              

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

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

                @ulrik Amazing! Forgot the function has override! 😎

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

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

                  @ustk said in Arc slider:

                  @ulrik Amazing! Forgot the function has override! 😎

                  Yes I had also forgot it, but I found it in the documentation.
                  So, what does "override" really means?

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

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

                    @ulrik A function override is the concept of writing the same function but for different parameters (type and or number of arguments). The compiler selects which one to use.

                    Although here it might not be a function override contrary to what I said, but probably more a simple check of the array in one unique function.

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

                    ulrikU U 3 Replies Last reply Reply Quote 1
                    • ulrikU
                      ulrik @ustk
                      last edited by

                      @ustk thanks!

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

                      U 2 Replies Last reply Reply Quote 0
                      • U
                        udalilprofile @ustk
                        last edited by

                        @ustkHello. I tried to set a gradient, but instead of an arch I got default buttons

                        1 Reply Last reply Reply Quote 0
                        • U
                          udalilprofile @ulrik
                          last edited by

                          @ulrikHello. An attempt to apply the gradient failed. I got the buttons. default)

                          1 Reply Last reply Reply Quote 0
                          • U
                            udalilprofile @ustk
                            last edited by

                            @ustk 11111.png

                            1 Reply Last reply Reply Quote 0
                            • U
                              udalilprofile @ulrik
                              last edited by

                              @ulrik 11111.png

                              ulrikU 2 Replies Last reply Reply Quote 0
                              • ulrikU
                                ulrik @udalilprofile
                                last edited by ulrik

                                @udalilprofile if it's inside a laf, you need to get the width and height from the obj.area
                                "this" will not work

                                g.setGradientFill([Colours.blue, 0, 0, Colours.red, obj.area[2], obj.area[3]]);
                                

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

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

                                  @udalilprofile when working with look and feel functions, it's very informative to

                                  Console.print(trace(obj));
                                  

                                  you will get all the information that is used inside.

                                  Same inside a keyPressCallback, use Console.print(trace(obj));
                                  or inside a mouseCallback, Console.print(trace(event));

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

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

                                  21

                                  Online

                                  1.7k

                                  Users

                                  11.8k

                                  Topics

                                  102.7k

                                  Posts