LAF ScriptSlider?
-
@d-healey :( Can't Understand This
-
@Natan Which part?
-
@d-healey The Circle That Moves, I Have no idea how to make it moving from left to right!
Simple to draw but how to make it slide?!!!Edit:
I'm trying to Create the slider In Look and Feel -
@Natan Scroll up to my post where I asked for help making a slider bi-directional. Use that as a starting point. All you have to do is draw a circle and change its x position based on the normalized value. Normalized value is always 0 - 1, so just use that as a percentage of the slider's width.
-
g.drawEllipse([a[0], a[1], a[2] * obj.valueNormalized, a[3]], 2);
Like This?
But this acts Very Crazy :/ -
@Natan
[x, y, w, h]
-
@d-healey Haha I See Some Moves :)
g.drawEllipse([15 * obj.valueNormalized, 15, a[3]/2, a[3]/2], 2);
-
@d-healey But It Goes Out of the Bounds!!!
HiseSnippet 1040.3ocsV0saZbDEdVr2zBsDUKkGfU4hJnkfAbrSkrrJwFHEEaGTvMpQVtoC6NKL0yNCZ1AaSh76Veb5k8MH8b1AXWmhcsPx6EvNme+lyb9Ny1Sq7YwwJMwI+ISGyHNeqa+oRynCFQ4RR2VDmG6dDM1vzdVQ6OcLMNlEPbbV6Un.m7qSRd9medepfJ8YohHj2o39rC4QbSpzdMeMWH5PCXmvixX8ya10WIOPITS.7rlaMxXp+4zgrionY4bINOpc.2nz8MTCKl3r99pfo8GotTZs+c7X9.ACWTmzGBjUbGkH.QLJkbvHtHn278cLAhRuzpvZ1pvSbOhGvWHOsZ7cIJ7R8Ha8vI2cAu5YgWs6O7bx.u0svaC299Z9XSpFDaeiaWIbPERgifrvxZKI2emy8.EXgzTMhdNqiFVrviR6TqVEusqUq7tEKTr.bPDa7DzPu87ZKGxkrp9ZFrsdkPMfJrg7Pk57WJC5vXhRV2.GppYC4XCSmIReCWIK8z.M8xCgPP08E7.l9oU7BmqbXEO0f+rbwBepXAO34Bp1iBIEDVkBYLIrnBdnWITXrYpf4s2ddMJaULyQ7YX0Xlw1.kX6fg1EH3RsID59dqZhDJ5uk4anxgBVoSomV6rJdzSqm7aije25L3uFY8Fet87wMrH6x5k2codr4l22768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I5fiDFteFYVhoIvA147I1CzSvoeQbwfnB29bVqwh.aTNvu2h7emvBy40AijL6xC+wa7lI.Cbwor3jTEjclVLObubivWJc2wsqv5GsZ9VZE7EJ2tu46r6W21scXHb5kS1Mc67q2+WlRf49VgZvoLqAKHcOaTbOn1xmCLQo3Rb7fSIrQNasGtFyL83pfzEXI3LgMv0NyD1XtPRLy2neueV6OdC9Wkh.bRk9gLaAeQErltnu200qtG1gIduuOlJdBv8UaSy0vlcWCad5ZXyyVCad9ZXyOtF17h6zF7a5d4HqNNqMA.51Nc9qiSaECpxRqHI+KPvrviJ
Haha Thank You Sir :) Awesome
-
@d-healey Sir, Code you please Let me know How I Can make this Fader Work As It Supposed to
The Mouse direction Is'nt Correct :/
I want this to go from down to top.laf.registerFunction("drawLinearSlider", function(g, obj) { var a = obj.area; if (obj.style == 3) { g.fillAll(0XFF3f3f3f); g.setColour(obj.itemColour1); var w = 20; var h = 20; var x = a[2] / 2 - h / 2; var y = a[3] * obj.valueNormalized - (w * obj.valueNormalized); g.fillRoundedRectangle([x, y, w, h], h); g.setColour(obj.itemColour1); g.fillRoundedRectangle([x, y, w, h], h); } });
-
laf.registerFunction("drawLinearSlider", function(g, obj) { var a = obj.area; if (obj.style == 3) { g.fillAll(0XFF3f3f3f); g.setColour(obj.itemColour1); var w = 20; var h = 20; var x = a[2] / 2 - h / 2; var y = a[3] - a[3] * obj.valueNormalized - h + h * obj.valueNormalized; g.fillRoundedRectangle([x, y, w, h], h); g.setColour(obj.itemColour1); g.fillRoundedRectangle([x, y, w, h], h); } });
-
@d-healey said in LAF ScriptSlider?:
laf.registerFunction("drawLinearSlider", function(g, obj)
{
var a = obj.area;if (obj.style == 3) { g.fillAll(0XFF3f3f3f); g.setColour(obj.itemColour1); var w = 20; var h = 20; var x = a[2] / 2 - h / 2; var y = a[3] - a[3] * obj.valueNormalized - h + h * obj.valueNormalized; g.fillRoundedRectangle([x, y, w, h], h); g.setColour(obj.itemColour1); g.fillRoundedRectangle([x, y, w, h], h); }
});
Brilliant :) Thank You Sir <3
-
@d-healey @ulrik
I Used the gradient Fill To colorize the Handle on The Fader!!!
But Gradient Doesn't move with The Fader!!!!It shows up On The Faders MAX Value, and When Move it Downward, It changes The Color,
Kinda gradient is fixed to the Background Position?!!!
Why?Content.makeFrontInterface(600, 500); const laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawLinearSlider", function(g, obj) { var a = obj.area; if (obj.style == 3) { g.fillAll(0XFF3f3f3f); g.setColour(obj.itemColour1); var w = a[2]; var h = 44; var x = 0; var y = a[3] - a[3] * obj.valueNormalized - h + h * obj.valueNormalized; g.setGradientFill([0XFF202020,0,0, 0XFF4B4B4B, 0, 45]); //Base g.fillRoundedRectangle([x, y, w, 44],3); } });
-
@Natan I don't know much about gradients, you'll need someone smarter ;)
-
@d-healey Thank You, Sir
-
@Natan You have to move the gradient as well, I’ll take à look tomorrow, now it’s bedtime 🥱
-
-
Anyone can Help me with this!!!
It works Upside Down Again :/Content.makeFrontInterface(600, 500); const laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawLinearSlider", function(g, obj) { var a = obj.area; if (obj.style == 3) { g.setColour(obj.bgColour); g.fillRoundedRectangle([a[0], a[1], a[2], a[3]], 6); g.setColour(obj.itemColour1); g.fillRoundedRectangle([a[0], a[1], a[2] , a[3]* obj.valueNormalized], 6); } });
HiseSnippet 1007.3ocsV0saaaCElxIrc1qtXAX2saH5U1CdFxMsoKHHXtIwtynIoFwYAqHnniVhRlKTjFTzIwsHua6QZuAcGJZaot4jEXfvKrw4+Ocz46P0WqBXooJMxq7oSGyPdOAOXpzLZ+QTtD06.j2SwGQSMLMwoZuoiooorPjm2Zuwpvq75nrye+K6QETY.KWEBclhGvNjmvM4Z629sbgnKMjcJOof2uncu.kbekPMAvyZXezXZvEzX1wTqakvHuG0IjaT5AFpgkh7VeOU3zAiTWIc9eFOkOTvrBsPCfD4T2UIBsH1pEs+HtHr+7m6TDjk94cg0bcguGeDOjuPed236xLPxinX+vqzcAuVEgm+8GddEf25N3sAdPflO1jawhsuE2SBunhnvqfhvx4KpzUkv6q.OjllIzKXc0fvhHpskueCxK88quS0JUq.uHRMDAMhrKoiLlKYMCzL3w5MB0PpvkxCUpKdsLrKiIp4BCBnolEysCLcmHCLbkr1yB0zqNDRAUOPvCY5m0fDM2XbChZ3eVuZkOWsBANWR0DJTTPYSJTwrzZMviH0rJSMSELxt6R1rtyvr.sm3loLia.Jy2gwNAK3x8IBl9NQMQBM8SXAFpLVvpcN8b+OzfPOuU1uOO62M+.72VEi1dt85wMrDmXq56bKQb+pNwU9eLqObIULgcrRmPE7OwBKhoalk+apuy7VJQIOVYXuSVqdkOWobkapP92lhhVpM6zgVIDL8RMaYq56JvZxIICY5FjL.uvQXr8q4E3amWTj1F3FVK3nR1SxMuaLSdarEzrIbKuYFp.WMYrlmNi03FBQbfb7X7akpgsPY.NeSTi1neq2ATCcdZfLBUYLSa31G.uCXWB60bjwx3CXoWXTiy7MYrRZqu2F+uE85EEr8IsmlKbZ6rYbjWE7Y1JFPEnDdXnf0Wkxss7haXAp13AvXQwEwIz7bide6zIQQ7qssrCQIpPvULtOUBIsPld+eMms.5dz1au8WrZymnsZ+BbrZABc7AbMKvAlmf+Ukl+InOAHMEdccJ6ZydpqsKethGZFAEz6Gf3Fw3wixuI3ORai9uK2fUrpvIBp4q26ZurYlAaQKtfytDSBcloE6AOHKiuuvcCbetIXzxwaokfWXP6gFuytZqJtSTD7lKGrqi696O72igfkdFtL9HpQaGFwGOIY.LWEv.jHkLgcwfWIKE1I6aksclALYXlfc7alwVVYuYFaM2HJgFnUeLvQ7sWd9MYZ.LIy9FhxvGy.xjELdL1uoukcw+XPfsU7S.1WdLOeEhYyUHlWrBw7xUHlsVgXd0JDyOemwX+bpWOwnRbzDPQ+NYad875HovTV1DI5eLGQV+I
-
@Natan It wasn't easy but I think this will work
Now I changed some of your original code but I've made some comments how I was thinking.
I hope you can use itHiseSnippet 1091.3ocsV0maaaCEmJIp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