LAF to draw text input of a slider?
-
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: -
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
-
@rglides Thanks, but that only seems to show the main register function and not others.
-
@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.
-
@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);
-
@rglides That doesn't change the appearance of the text input.
-
@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
-
I need this as well. Does anybody have a work-around?
-
-
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);