HISE Logo Forum
    • Categories
    • Register
    • Login

    LAF to draw text input of a slider?

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

      Is there an LAF register function available for text box value input for a slider?
      Here I am using a slider as a drag number and I am getting this:

      Screenshot 2025-05-30 at 10.44.55 AM.png

      Screenshot 2025-06-02 at 2.34.59 PM.png

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

      1 Reply Last reply Reply Quote 0
      • rglidesR
        rglides
        last edited by

        If you right click on a component in your UI it gives you the option to create a local laf for it. Pasting that into the script should then give you all possible laf functions for that component

        VirtualVirginV rglidesR 2 Replies Last reply Reply Quote 0
        • VirtualVirginV
          VirtualVirgin @rglides
          last edited by

          @rglides Thanks, but that only seems to show the main register function and not others.

          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

            @VirtualVirgin No there isn't. What you might be able to do is use a broadcaster to intercept the action that opens the input box and use a modal text input which I believe has some styling options (forum search required). Or perhaps even design a custom input with a panel and a label.

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

            1 Reply Last reply Reply Quote 1
            • rglidesR
              rglides @rglides
              last edited by rglides

              @rglides I knew I had something somewhere for this, sorry took a moment, had to delete a bunch to give you a minimal version - this works with a vertical slider -

              const var Knob1 = Content.getComponent("Knob1");
              
              const ValueLAF = Content.createLocalLookAndFeel();
              ValueLAF.registerFunction("drawLinearSlider", function(g, obj)
              {    
                  g.setColour(Colours.white);
                  g.setFont("Arial", 20);
              
                  var area = obj.area;
                  g.drawAlignedText(Math.round(obj.value), [0, 0, area[2], area[3]], "centred");
              });
              
              Knob1.setLocalLookAndFeel(ValueLAF);
              
              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @rglides
                last edited by

                @rglides That doesn't change the appearance of the text input.

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

                rglidesR 1 Reply Last reply Reply Quote 0
                • rglidesR
                  rglides @d.healey
                  last edited by

                  @d-healey oh haha, I'm being dumb again, I thought it was to style the value for the slider. Really I have a problem reading sometimes smh

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

                    I need this as well. Does anybody have a work-around?

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

                      @Chazrox Look at my post above https://forum.hise.audio/topic/12796/laf-to-draw-text-input-of-a-slider/4?_=1748905857089

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

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

                        I just found this on the forum compliments to @HISEnberg ! 🙏

                        https://forum.hise.audio//post/100409

                        Content.makeFrontInterface(200, 50);
                        
                        const var Label1 = Content.getComponent("Label1");
                        
                        const var lblCss = Content.createLocalLookAndFeel();
                        
                        Label1.set("text", "CSS Label");
                        
                        
                        // Email/Key Label Laf
                        lblCss.setInlineStyleSheet("
                        *
                        {
                        	letter-spacing: 2px;
                        	font-weight: regular;
                        }
                        
                        /** Render the default appearance. */
                        label
                        {
                        	background-color: var(--bgColour);
                        	color: var(--textColour);	
                        	border-radius: 5px;
                        	padding-left: 50px;
                        	padding-right: 20px;
                        	text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
                        }
                        
                        /** If you edit the text, it will use this selector. */
                        input
                        {
                        
                        	text-align: left;
                        	padding-top: 0.5px;
                        	padding-left: 50px;
                        	padding-right: 20px;
                        	caret-color: white;
                        	font-weight: bold;
                        }
                        
                        /** Style the text selection with this selector. */
                        ::selection
                        {
                        	background: #50FFFFFF;
                        	color: white;
                        }
                        ");
                        
                        Label1.setLocalLookAndFeel(lblCss);
                        
                        
                        1 Reply Last reply Reply Quote 2
                        • First post
                          Last post

                        26

                        Online

                        1.7k

                        Users

                        11.9k

                        Topics

                        103.4k

                        Posts