Forum
    • Categories
    • Register
    • Login

    How to Crop button bounding boxes

    Scheduled Pinned Locked Moved General Questions
    25 Posts 4 Posters 1.6k 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.
    • David HealeyD
      David Healey @David Healey
      last edited by

      @David-Healey not sure what you mean about limiting peaks, do you have a snippet you could share?

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

      1 Reply Last reply Reply Quote 0
      • J
        Jeetender @David Healey
        last edited by

        @David-Healey is there any way to limit the peaks in the matrix peak meter to the panel size? if teh signal gets loud the peaks go outbounds

        1 Reply Last reply Reply Quote 0
        • J
          Jeetender @David Healey
          last edited by

          @David-Healey like in this image, the first image there are red peaks, but as the signal gets loud or i push, the red peaks are supposed to stop at the top of bounding floating tile box.

          Untitled.png Untitled2.png

          David HealeyD 1 Reply Last reply Reply Quote 0
          • David HealeyD
            David Healey @Jeetender
            last edited by

            @Jeetender Try adjusting the skew factor and padding size settings.

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

            J 1 Reply Last reply Reply Quote 0
            • J
              Jeetender @David Healey
              last edited by Jeetender

              @David-Healey ok, i tried different settings but it did not work.
              the red peaks are supposed to stop right at the top.

              Untitled2.png

              David HealeyD ChazroxC 2 Replies Last reply Reply Quote 0
              • David HealeyD
                David Healey @Jeetender
                last edited by

                @Jeetender post a minimal snippet

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

                J 1 Reply Last reply Reply Quote 0
                • J
                  Jeetender @David Healey
                  last edited by

                  @David-Healey ```
                  HiseSnippet 1788.3oc6Y80aSbDDeu3b.17mBTpTep5DsphVAQwgjPgWvwIwTWhCV4BApZprVe253UducOc2dj3hPpO1uBsppeD568Mj52i9Yne.PhN6d246bhSvXfTfV+.hclcu82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nNpX4Sok.1MWWvnnYC0XqC7G0AHwAVwVNNC+oNvBmaRW30mzEN+jtvElzEt3jtvaLoK7qdwKTUzZoHovKNkEgZzbU8CpXXLnICiBn+g1D50G

                  David HealeyD 1 Reply Last reply Reply Quote 0
                  • David HealeyD
                    David Healey @Jeetender
                    last edited by

                    @Jeetender I think you'll need to use custom look and feel to achieve what you want.

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

                    J 1 Reply Last reply Reply Quote 0
                    • J
                      Jeetender @David Healey
                      last edited by

                      @David-Healey well i made a panel meter i used in last project. thanx anyways. are there any new modules added to HISE lately, ive been away for like 4 months now.?

                      David HealeyD 1 Reply Last reply Reply Quote 0
                      • David HealeyD
                        David Healey @Jeetender
                        last edited by

                        @Jeetender I don't think anything significant has been added, have a look through the github commits to be sure.

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

                        J 1 Reply Last reply Reply Quote 0
                        • J
                          Jeetender @David Healey
                          last edited by

                          @David-Healey OK david i will update, i just need to confirm i did not install faust at first when i pulled hise, now how can i install faust ?

                          David HealeyD 1 Reply Last reply Reply Quote 0
                          • David HealeyD
                            David Healey @Jeetender
                            last edited by

                            @Jeetender Should be the same as with a fresh setup.

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

                            J 1 Reply Last reply Reply Quote 0
                            • J
                              Jeetender @David Healey
                              last edited by

                              @David-Healey so can i install faust as i update?

                              David HealeyD 1 Reply Last reply Reply Quote 0
                              • David HealeyD
                                David Healey @Jeetender
                                last edited by

                                @Jeetender Yeah

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

                                1 Reply Last reply Reply Quote 0
                                • ChazroxC
                                  Chazrox @Jeetender
                                  last edited by

                                  @Jeetender Try this. You'll have to use two vertical sliders and style them with this laf to get that look with this script. You can figure out how to customize it by reading the comments.

                                  const var LED_Meter_Rectangle_TempGrade_HardStops = Content.createLocalLookAndFeel();
                                  
                                  LED_Meter_Rectangle_TempGrade_HardStops.registerFunction("drawLinearSlider", function(g, obj)
                                  {
                                      // ---- COLOUR CONTROL ----
                                      // Every colour this LookAndFeel draws with, in one place. Each name is one control in the
                                      // designer, so editing a value here changes that control and nothing else. The draw code
                                      // below only ever references these by name.
                                      var c_fillColourBot         = 0xFF03B300;
                                      var c_fillGradMidColour     = 0xFFFF981A;
                                      var c_fillColourTop         = 0xFFFF0A0A;
                                      var c_fillColourBot_a35     = 0x5903B300;
                                      var c_fillGradMidColour_a35 = 0x59FF981A;
                                      var c_fillColourTop_a35     = 0x59FF0A0A;
                                      var c_fillColourBot_a55     = 0x8C03B300;
                                      var c_fillGradMidColour_a55 = 0x8CFF981A;
                                      var c_fillColourTop_a55     = 0x8CFF0A0A;
                                      // Per-LED colour tables, sampled along the Fill gradient (one entry per LED).
                                      var ledColours = [
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillColourBot,
                                          c_fillGradMidColour,
                                          c_fillGradMidColour,
                                          c_fillGradMidColour,
                                          c_fillGradMidColour,
                                          c_fillGradMidColour,
                                          c_fillGradMidColour,
                                          c_fillColourTop,
                                          c_fillColourTop
                                      ];
                                      var ledOffColours = [
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillColourBot_a35,
                                          c_fillGradMidColour_a35,
                                          c_fillGradMidColour_a35,
                                          c_fillGradMidColour_a35,
                                          c_fillGradMidColour_a35,
                                          c_fillGradMidColour_a35,
                                          c_fillGradMidColour_a35,
                                          c_fillColourTop_a35,
                                          c_fillColourTop_a35
                                      ];
                                      var ledGlowColours = [
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillColourBot_a55,
                                          c_fillGradMidColour_a55,
                                          c_fillGradMidColour_a55,
                                          c_fillGradMidColour_a55,
                                          c_fillGradMidColour_a55,
                                          c_fillGradMidColour_a55,
                                          c_fillGradMidColour_a55,
                                          c_fillColourTop_a55,
                                          c_fillColourTop_a55
                                      ];
                                  
                                      // ---- GEOMETRY ----
                                      var a = obj.area;
                                      var isH = false; // exported from current designer orientation
                                      var norm = (obj.valueNormalized !== undefined) ? obj.valueNormalized : ((obj.value - obj.min) / (obj.max - obj.min));
                                      norm = Math.max(0.0, Math.min(1.0, norm));
                                      // Axis-aware scale: horizontal skins scale from component width; vertical skins scale from component height.
                                      // This keeps slider element proportions stable when exporting either orientation.
                                      var scaleBase = isH ? a[2] : a[3];
                                      var sw = scaleBase / 300.0;
                                      // Output bounds: master Draw Padding on each edge (px @300 design).
                                      var padL = sw * 4.0000;
                                      var padR = sw * 4.0000;
                                      var padT = sw * 4.0000;
                                      var padB = sw * 4.0000;
                                      var dW = Math.max(1.0, a[2] - padL - padR); var dH = Math.max(1.0, a[3] - padT - padB);
                                      // Position the clamped rect by the pad ratio so a large pad never drifts the slider off-axis.
                                      var sumX = padL + padR; var sumY = padT + padB;
                                      var dX = a[0] + (sumX > 0.0 ? (a[2] - dW) * (padL / sumX) : (a[2] - dW) * 0.5);
                                      var dY = a[1] + (sumY > 0.0 ? (a[3] - dH) * (padT / sumY) : (a[3] - dH) * 0.5);
                                      var drawBase = isH ? dW : dH;
                                      var trackThick = drawBase * 0.1500;
                                      var fillThick = drawBase * 0.1200;
                                      var hPad = (isH ? dW : dH) * 0.0200;
                                      var tX, tY, tW, tH;
                                      if (isH) {
                                          tX = dX + hPad; tY = dY + dH * 0.5 - trackThick * 0.5;
                                          tW = dW - hPad * 2; tH = trackThick;
                                      } else {
                                          tX = dX + dW * 0.5 - trackThick * 0.5; tY = dY + hPad;
                                          tW = trackThick; tH = dH - hPad * 2;
                                      }
                                      // Fill has its own cross-axis thickness, anchored to the same centre-line as the track
                                      var fbX, fbY, fbW, fbH;
                                      if (isH) {
                                          fbX = tX; fbY = dY + dH * 0.5 - fillThick * 0.5;
                                          fbW = tW; fbH = fillThick;
                                      } else {
                                          fbX = dX + dW * 0.5 - fillThick * 0.5; fbY = tY;
                                          fbW = fillThick; fbH = tH;
                                      }
                                      // Radius from the rail THICKNESS (cross-axis) so the end caps keep one shape at any length.
                                      var tR = (isH ? tH : tW) * 0.1100;
                                      var thumbBaseW = drawBase * 0.1314;
                                      var thumbBaseH = drawBase * 0.0657;
                                      var thumbW, thumbH;
                                      if (Math.abs(thumbBaseW - thumbBaseH) < 0.0001) {
                                          thumbW = thumbBaseW; thumbH = thumbBaseW;
                                      } else {
                                          // Rotate width / height with orientation, so a 200x100 vertical handle becomes 100x200 horizontal.
                                          thumbW = isH ? thumbBaseH : thumbBaseW;
                                          thumbH = isH ? thumbBaseW : thumbBaseH;
                                      }
                                      var thumbSz = Math.max(thumbW, thumbH);
                                      // Thumb travel range: 0 = left / bottom, 1 = right / top
                                      var trMin = Math.min(0.0000, 1.0000);
                                      var trMax = Math.max(0.0000, 1.0000);
                                      var travelNorm = trMin + (trMax - trMin) * norm;
                                      // The thumb travels the TRACK RAIL - the same span the fill covers and the ticks sit on - so
                                      // all three stay in step. Track Pad insets the rail, and therefore the throw, by design.
                                      var railStart = isH ? tX : tY;
                                      var railLen = isH ? tW : tH;
                                      var thumbCX = isH ? railStart + railLen * travelNorm : dX + dW * 0.5;
                                      var thumbCY = isH ? dY + dH * 0.5 : railStart + railLen * (1.0 - travelNorm);
                                  
                                      // ---- FILL LED SEGMENTS ---- (rectangle shape)
                                      // Each LED is a solid segment coloured by its slot position in the Fill gradient. Crisp on/off meter.
                                      var ledN = 23;
                                      var ledLit = Math.round(norm * ledN);
                                      var ledAlong = isH ? fbW : fbH;
                                      var ledPitch = ledAlong / ledN;
                                      var ledLen = Math.max(0.5, ledPitch * 0.8200);
                                      var ledThick = Math.max(0.5, fillThick * 1.0000);
                                      var ledCross = isH ? (fbY + fbH * 0.5) : (fbX + fbW * 0.5);
                                      // LED Glow - blur the lit segments behind the meter
                                      if (ledLit > 0) {
                                          g.beginLayer(false);
                                          for (var fgi = 0; fgi < ledLit; fgi++) {
                                              var fgAlong = isH ? (fbX + (fgi + 0.5) * ledPitch) : ((fbY + fbH) - (fgi + 0.5) * ledPitch);
                                              var fglx = isH ? (fgAlong - ledLen * 0.5) : (ledCross - ledThick * 0.5);
                                              var fgly = isH ? (ledCross - ledThick * 0.5) : (fgAlong - ledLen * 0.5);
                                              var fglw = isH ? ledLen : ledThick;
                                              var fglh = isH ? ledThick : ledLen;
                                              g.setColour(ledGlowColours[fgi]);
                                              g.fillRoundedRectangle([fglx, fgly, fglw, fglh], Math.min(fglw, fglh) * 0.1100);
                                          }
                                          g.gaussianBlur(Math.round(Math.max(0.0, 5.0 * sw)));
                                          g.endLayer();
                                      }
                                      for (var li = 0; li < ledN; li++) {
                                          var lAlong = isH ? (fbX + (li + 0.5) * ledPitch) : ((fbY + fbH) - (li + 0.5) * ledPitch);
                                          var lx = isH ? (lAlong - ledLen * 0.5) : (ledCross - ledThick * 0.5);
                                          var ly = isH ? (ledCross - ledThick * 0.5) : (lAlong - ledLen * 0.5);
                                          var lw = isH ? ledLen : ledThick;
                                          var lh = isH ? ledThick : ledLen;
                                          var lr = Math.min(lw, lh) * 0.1100;
                                          var ledDrawn = true;
                                          if (ledDrawn) {
                                              if (li < ledLit) {
                                                  g.setColour(ledColours[li]);
                                                  g.fillRoundedRectangle([lx, ly, lw, lh], lr);
                                              }
                                              else {
                                                  // Opaque black base first: Off Alpha then blends the dim colour over it, so a
                                                  // low alpha fades toward BLACK instead of letting the background show through.
                                                  g.setColour(0xFF000000);
                                                  g.fillRoundedRectangle([lx, ly, lw, lh], lr);
                                                  g.setColour(ledOffColours[li]);
                                                  g.fillRoundedRectangle([lx, ly, lw, lh], lr);
                                              }
                                          }
                                      }
                                  
                                  });
                                  

                                  LED_Meter_Rectangle_TempGrade_HardStops.png

                                  Dont mind the yellow dash lines. Thats just the guidelines from the designer app. Those wont come out in the render.

                                  David HealeyD J 2 Replies Last reply Reply Quote 1
                                  • David HealeyD
                                    David Healey @Chazrox
                                    last edited by

                                    @Chazrox said in How to Crop button bounding boxes:

                                    Try this. You'll have to use two vertical sliders and style them with this laf to get that look with this script. You can figure out how to customize it by reading the comments.

                                    If you're using laf anyway why not use the peak meter floating tile?

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

                                    ChazroxC 2 Replies Last reply Reply Quote 0
                                    • ChazroxC
                                      Chazrox @David Healey
                                      last edited by

                                      @David-Healey adjusting the colours exactly how he wants.

                                      1 Reply Last reply Reply Quote 0
                                      • ChazroxC
                                        Chazrox @David Healey
                                        last edited by

                                        @David-Healey just another option for the guy. just sharing.

                                        1 Reply Last reply Reply Quote 2
                                        • J
                                          Jeetender @Chazrox
                                          last edited by

                                          @Chazrox said in How to Crop button bounding boxes:

                                          @Jeetender Try this. You'll have to use two vertical sliders and style them with this laf to get that look with this script. You can figure out how to customize it by reading the comments.

                                          const var LED_Meter_Rectangle_TempGrade_HardStops = Content.createLocalLookAndFeel();
                                          
                                          LED_Meter_Rectangle_TempGrade_HardStops.registerFunction("drawLinearSlider", function(g, obj)
                                          {
                                              // ---- COLOUR CONTROL ----
                                              // Every colour this LookAndFeel draws with, in one place. Each name is one control in the
                                              // designer, so editing a value here changes that control and nothing else. The draw code
                                              // below only ever references these by name.
                                              var c_fillColourBot         = 0xFF03B300;
                                              var c_fillGradMidColour     = 0xFFFF981A;
                                              var c_fillColourTop         = 0xFFFF0A0A;
                                              var c_fillColourBot_a35     = 0x5903B300;
                                              var c_fillGradMidColour_a35 = 0x59FF981A;
                                              var c_fillColourTop_a35     = 0x59FF0A0A;
                                              var c_fillColourBot_a55     = 0x8C03B300;
                                              var c_fillGradMidColour_a55 = 0x8CFF981A;
                                              var c_fillColourTop_a55     = 0x8CFF0A0A;
                                              // Per-LED colour tables, sampled along the Fill gradient (one entry per LED).
                                              var ledColours = [
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillColourBot,
                                                  c_fillGradMidColour,
                                                  c_fillGradMidColour,
                                                  c_fillGradMidColour,
                                                  c_fillGradMidColour,
                                                  c_fillGradMidColour,
                                                  c_fillGradMidColour,
                                                  c_fillColourTop,
                                                  c_fillColourTop
                                              ];
                                              var ledOffColours = [
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillColourBot_a35,
                                                  c_fillGradMidColour_a35,
                                                  c_fillGradMidColour_a35,
                                                  c_fillGradMidColour_a35,
                                                  c_fillGradMidColour_a35,
                                                  c_fillGradMidColour_a35,
                                                  c_fillGradMidColour_a35,
                                                  c_fillColourTop_a35,
                                                  c_fillColourTop_a35
                                              ];
                                              var ledGlowColours = [
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillColourBot_a55,
                                                  c_fillGradMidColour_a55,
                                                  c_fillGradMidColour_a55,
                                                  c_fillGradMidColour_a55,
                                                  c_fillGradMidColour_a55,
                                                  c_fillGradMidColour_a55,
                                                  c_fillGradMidColour_a55,
                                                  c_fillColourTop_a55,
                                                  c_fillColourTop_a55
                                              ];
                                          
                                              // ---- GEOMETRY ----
                                              var a = obj.area;
                                              var isH = false; // exported from current designer orientation
                                              var norm = (obj.valueNormalized !== undefined) ? obj.valueNormalized : ((obj.value - obj.min) / (obj.max - obj.min));
                                              norm = Math.max(0.0, Math.min(1.0, norm));
                                              // Axis-aware scale: horizontal skins scale from component width; vertical skins scale from component height.
                                              // This keeps slider element proportions stable when exporting either orientation.
                                              var scaleBase = isH ? a[2] : a[3];
                                              var sw = scaleBase / 300.0;
                                              // Output bounds: master Draw Padding on each edge (px @300 design).
                                              var padL = sw * 4.0000;
                                              var padR = sw * 4.0000;
                                              var padT = sw * 4.0000;
                                              var padB = sw * 4.0000;
                                              var dW = Math.max(1.0, a[2] - padL - padR); var dH = Math.max(1.0, a[3] - padT - padB);
                                              // Position the clamped rect by the pad ratio so a large pad never drifts the slider off-axis.
                                              var sumX = padL + padR; var sumY = padT + padB;
                                              var dX = a[0] + (sumX > 0.0 ? (a[2] - dW) * (padL / sumX) : (a[2] - dW) * 0.5);
                                              var dY = a[1] + (sumY > 0.0 ? (a[3] - dH) * (padT / sumY) : (a[3] - dH) * 0.5);
                                              var drawBase = isH ? dW : dH;
                                              var trackThick = drawBase * 0.1500;
                                              var fillThick = drawBase * 0.1200;
                                              var hPad = (isH ? dW : dH) * 0.0200;
                                              var tX, tY, tW, tH;
                                              if (isH) {
                                                  tX = dX + hPad; tY = dY + dH * 0.5 - trackThick * 0.5;
                                                  tW = dW - hPad * 2; tH = trackThick;
                                              } else {
                                                  tX = dX + dW * 0.5 - trackThick * 0.5; tY = dY + hPad;
                                                  tW = trackThick; tH = dH - hPad * 2;
                                              }
                                              // Fill has its own cross-axis thickness, anchored to the same centre-line as the track
                                              var fbX, fbY, fbW, fbH;
                                              if (isH) {
                                                  fbX = tX; fbY = dY + dH * 0.5 - fillThick * 0.5;
                                                  fbW = tW; fbH = fillThick;
                                              } else {
                                                  fbX = dX + dW * 0.5 - fillThick * 0.5; fbY = tY;
                                                  fbW = fillThick; fbH = tH;
                                              }
                                              // Radius from the rail THICKNESS (cross-axis) so the end caps keep one shape at any length.
                                              var tR = (isH ? tH : tW) * 0.1100;
                                              var thumbBaseW = drawBase * 0.1314;
                                              var thumbBaseH = drawBase * 0.0657;
                                              var thumbW, thumbH;
                                              if (Math.abs(thumbBaseW - thumbBaseH) < 0.0001) {
                                                  thumbW = thumbBaseW; thumbH = thumbBaseW;
                                              } else {
                                                  // Rotate width / height with orientation, so a 200x100 vertical handle becomes 100x200 horizontal.
                                                  thumbW = isH ? thumbBaseH : thumbBaseW;
                                                  thumbH = isH ? thumbBaseW : thumbBaseH;
                                              }
                                              var thumbSz = Math.max(thumbW, thumbH);
                                              // Thumb travel range: 0 = left / bottom, 1 = right / top
                                              var trMin = Math.min(0.0000, 1.0000);
                                              var trMax = Math.max(0.0000, 1.0000);
                                              var travelNorm = trMin + (trMax - trMin) * norm;
                                              // The thumb travels the TRACK RAIL - the same span the fill covers and the ticks sit on - so
                                              // all three stay in step. Track Pad insets the rail, and therefore the throw, by design.
                                              var railStart = isH ? tX : tY;
                                              var railLen = isH ? tW : tH;
                                              var thumbCX = isH ? railStart + railLen * travelNorm : dX + dW * 0.5;
                                              var thumbCY = isH ? dY + dH * 0.5 : railStart + railLen * (1.0 - travelNorm);
                                          
                                              // ---- FILL LED SEGMENTS ---- (rectangle shape)
                                              // Each LED is a solid segment coloured by its slot position in the Fill gradient. Crisp on/off meter.
                                              var ledN = 23;
                                              var ledLit = Math.round(norm * ledN);
                                              var ledAlong = isH ? fbW : fbH;
                                              var ledPitch = ledAlong / ledN;
                                              var ledLen = Math.max(0.5, ledPitch * 0.8200);
                                              var ledThick = Math.max(0.5, fillThick * 1.0000);
                                              var ledCross = isH ? (fbY + fbH * 0.5) : (fbX + fbW * 0.5);
                                              // LED Glow - blur the lit segments behind the meter
                                              if (ledLit > 0) {
                                                  g.beginLayer(false);
                                                  for (var fgi = 0; fgi < ledLit; fgi++) {
                                                      var fgAlong = isH ? (fbX + (fgi + 0.5) * ledPitch) : ((fbY + fbH) - (fgi + 0.5) * ledPitch);
                                                      var fglx = isH ? (fgAlong - ledLen * 0.5) : (ledCross - ledThick * 0.5);
                                                      var fgly = isH ? (ledCross - ledThick * 0.5) : (fgAlong - ledLen * 0.5);
                                                      var fglw = isH ? ledLen : ledThick;
                                                      var fglh = isH ? ledThick : ledLen;
                                                      g.setColour(ledGlowColours[fgi]);
                                                      g.fillRoundedRectangle([fglx, fgly, fglw, fglh], Math.min(fglw, fglh) * 0.1100);
                                                  }
                                                  g.gaussianBlur(Math.round(Math.max(0.0, 5.0 * sw)));
                                                  g.endLayer();
                                              }
                                              for (var li = 0; li < ledN; li++) {
                                                  var lAlong = isH ? (fbX + (li + 0.5) * ledPitch) : ((fbY + fbH) - (li + 0.5) * ledPitch);
                                                  var lx = isH ? (lAlong - ledLen * 0.5) : (ledCross - ledThick * 0.5);
                                                  var ly = isH ? (ledCross - ledThick * 0.5) : (lAlong - ledLen * 0.5);
                                                  var lw = isH ? ledLen : ledThick;
                                                  var lh = isH ? ledThick : ledLen;
                                                  var lr = Math.min(lw, lh) * 0.1100;
                                                  var ledDrawn = true;
                                                  if (ledDrawn) {
                                                      if (li < ledLit) {
                                                          g.setColour(ledColours[li]);
                                                          g.fillRoundedRectangle([lx, ly, lw, lh], lr);
                                                      }
                                                      else {
                                                          // Opaque black base first: Off Alpha then blends the dim colour over it, so a
                                                          // low alpha fades toward BLACK instead of letting the background show through.
                                                          g.setColour(0xFF000000);
                                                          g.fillRoundedRectangle([lx, ly, lw, lh], lr);
                                                          g.setColour(ledOffColours[li]);
                                                          g.fillRoundedRectangle([lx, ly, lw, lh], lr);
                                                      }
                                                  }
                                              }
                                          
                                          });
                                          

                                          LED_Meter_Rectangle_TempGrade_HardStops.png

                                          Dont mind the yellow dash lines. Thats just the guidelines from the designer app. Those wont come out in the render.

                                          now this seems to be working fine and much customizable.. thanx a lot brother.

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

                                            @Jeetender This is a simple Laf version

                                            HiseSnippet 2193.3oc6Y80aabbDeOIcNlrwMwot.8ohEJEETxTL7zerchaQn9GSXijLgnrhCrDTWd2Rxs73sGt6njXcDPereExa8SPeuuEf1OGE8iP+.D.2Y18NdGknjkYiMpcMePP6Lyt6LyNyuY18pGHs4ggx.hQ98F3yIFuuYiAdQcVuCS3QpsAw3Vl62eaVTf3zsXsHqMvmEFxcHFFS+EnHF4lgn98u+70XtLOadJIBYeovluknmHJkZ8Jekv0sJygumnWFoWtRMao25RWYePcl1rLwmY2k0luCCEaJSxWxB6PLl2z1YY6ksuWyksXrV22p483Mef08s3OvdEmO01lYuRSaqkVhQLtwlNhHYPiHVDOjXLyZRmAM5HOwSuA6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mf0kyvQdNgzER4Q+0zp8i5Gvo65s1AaDzu2Qn5FdvVM1qQ0cOZynN7.Ny8ngrNZwirrVYs5aez5eboSXGSTuAi9bV89K5+0EDUYGYIromSxvyiqNy0CW8E7Uxl4U0WI60b99+suOvONeTubI5nt36lPQRWHIbHpeKVe2nDpilAtszSlbaprAw.xQ617fr59XMnUihfDoTJ2oxtbWNKLS1xupxVvUlXAmOO7kvWX8R+ANG640uvTqtTD1f91w65L8aZuqyaNk3dcrG8X1Axir0OBDFKeSEEvt8TELxYtMNlN5GER8qGfJdjs8nK0El3hS5DWZRm3xS5DWYRm38lzId+IchO3EOQrn0p8ij8zorDx102T8.LFFCaxvXZx+gHAGLe
                                            

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

                                            J 1 Reply Last reply Reply Quote 4
                                            • First post
                                              Last post

                                            13

                                            Online

                                            3.1k

                                            Users

                                            14.0k

                                            Topics

                                            122.0k

                                            Posts