Solved Drawing an arc for the knob LAF; where am I going wrong?
-
I'm trying to make an arc in my knob. I'm taking inspiration from the snippets in the github repository but I don't fully understand how it works. My code returns an "unstyled" knob.
laf.registerFunction("drawRotarySlider", function(g, obj) { var a = obj.area; // Draw the background ellipse g.setColour(obj.bgColour); g.fillEllipse(a); // Draw the inner ellipse g.setColour(obj.itemColour1); g.fillEllipse([10, 10, a[2] - 20, a[3] - 20]); // Calculate the rotation angle for the arc var start = 0; // Starting at 0 radians var end = 2 * Math.PI * obj.valueNormalized; // Ending at 2π radians for full rotation // Define the arc path var p1 = Content.createPath(); var arcThickness = 10; // Thickness of the arc var arcMargin = 15; // not sure p1.addArc([arcMargin, arcMargin, a[2] - 2 * arcMargin, a[3] - 2 * arcMargin], start, end); // not sure // Draw the value arc with .textColour g.setColour(obj.textColour); g.strokePath(p1, { "thickness": arcThickness }); // Draw the needle g.rotate(end, [a[2] / 2, a[3] / 2]); g.setColour(obj.itemColour2); g.fillRect([a[2] / 2 - 8 / 2, 0, 8, 40]); });
-
@Mighty23 said in Drawing an arc for the knob LAF; where am I going wrong?:
My code returns an "unstyled" knob.
Are you using local look and feel (you should be), or global look and feel?
-
@d-healey mine is:
const laf = Engine.createGlobalScriptLookAndFeel();
the "basic" version (without drawing the arc) of my knob works, I have to restart HISE to see the result, but it works. Should I set a local look and feel instead of a global? Checking the API I only find this:
@d-healey said in Drawing an arc for the knob LAF; where am I going wrong?:
Are you using local look and feel (you should be), or global look and feel?
-
@Mighty23 Yes always use local LAF if you can (there are a few places where only global will work but for the majority of components you can use local).
-
@d-healey
This version not works//KNOBS LAF const laf = Content.createLocalLookAndFeel(); const var Knob16 = Content.getComponent("Knob16"); laf.registerFunction("drawRotarySlider", function(g, obj) { var a = obj.area; // Draw the background ellipse g.setColour(obj.bgColour); g.fillEllipse(a); // Draw the inner ellipse g.setColour(obj.itemColour1); g.fillEllipse([10, 10, a[2] - 20, a[3] - 20]); // Calculate the rotation angle for the arc var start = 0; // Starting at 0 radians var end = 2 * Math.PI * obj.valueNormalized; // Ending at 2π radians for full rotation // Define the arc path var p1 = Content.createPath(); var arcThickness = 10; // Thickness of the arc var arcMargin = 15; // Margin from the edge of the component p1.addArc([arcMargin, arcMargin, a[2] - 2 * arcMargin, a[3] - 2 * arcMargin], start, end); // Draw the value arc with .textColour g.setColour(obj.textColour); g.strokePath(p1, { "thickness": arcThickness }); // Draw the needle g.rotate(end, [a[2] / 2, a[3] / 2]); g.setColour(obj.itemColour2); g.fillRect([a[2] / 2 - 8 / 2, 0, 8, 40]); }); Knob16.setLocalLookAndFeel(laf);
-
@Mighty23 Can you share that as a snippet so I see what you see?
-
HiseSnippet 4695.3oc6b0DaajjctokaYIJOy3Ys2M.4PRuBSVP4gCc2M+ONdL0uVJi9gVTi2YWGCMsXWjrG0ra5tapelAdgR.BvDDDjcys81dO.4RNDDjK9TR.xgrA4Ttsmx48Ttj.37pp5eppYSJJZ4wXFHYXa1UUup9du58d0WUcQU2wtIx001QH0r6cZOjPpaJ13TKuNK2QyvRXiUDRMiXcGjKxSXoS6o45hzERkZpGgqM0rWWf7yu8gKoYpY0DEUjfvSrMZh1znqgWTo0q8IFllqooi1ynKSqKTail1VKaaZ2GPxThxB8zZdnVaz1Z3lcMQgTSuptgmsSCOMOjqPpqujs9oM5XerEs8Owv03.SD9AEgFPGQKdMaScLhwkJrbGCS85AZrq.zK0iz+on5+cD2xP2Hr7H6vsHUHEIAq8H003g2TbvSgEdxLvKAHkhARWmBo2WrQSGiddQ0fwybhaX4gbZoAlcVnPaqv0ty2SbYanEVd45pcHZMG3gPIxnnTnPVo7JpKb+zou289js2YoFRat3ZoSCSDtdRlZsjdfTPGzzAA50l1M0L2z19vEszWCgLy.xRa8QZNRehk8AJkXDpMxaY6t8rsfGxLOs54wCGz24bPsMbAvrVeqldF1VYlW2Q63cs8zbNsgogNxY9rRsBprcVI6C9hER+UokfevilFLPPQ4z.jceRoj+4d2SZEnej75fjN.bgZ6X22RWBYZZzyEQZR6btXfgc0xf6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NZ9MwXzUqoi899uIVxhtjR.81hbO8mUbK7yRI7aJhtF5F62rIeWMffpSpf4mTAKLoBVbRErzjJX4IUvJmuf3eC55SaCmMQPXq5qRh4SkJfoMDEJ7+C3YgYQ
-
@Mighty23 Check the Y position of your knob, it's not visible on the UI currently, same with Knob10.
-
@d-healey those are knobs that I should eliminate at the "final" version, they are only for "debugging" reasons.
Since knobman gallery doesn't work anymore, I decided to start studying how to customize knobs via code. The result I get is knob unstyled, look at knob16.
-
@Mighty23 Knob16 is not visible on your UI
If you move the Y position you will see it
-
@d-healey ok I understand now what you mean, the fact is that there is no Arc visualzation, only the basic implementation.
I made an embarrassing mistake, is knob17. After the adjustments, the arc still does not display. I expect the knob to draw an arc of color ".textColour"HiseSnippet 4589.3oc6b0DabijclskorTaOY7r1aBPNjvUXxhVd5oMI6+iiG25WKkQRtsZMd8tdMzR0r5t4H1jsIYqelAdgQ.BvDDDjcOt216AXurmBxk4TR.1CaBxobaOky6obIAX12qJ9SQ1rkZIKOFy.ICY00uuu2qduW8whkTSG61DWWaGgLytywCHBYtgXqis75sTOMCKg0WVHyLhMcHtDOgEOdflqKQWHSlodH1ZlYup.8qe+CVTyTypMIpJAgmXazlrgQeCunZa13iMLMWUSmriQetdWpw5sssVx1zdHfjoDkEFn0destjszvtcEQgLSuhtgmsSKOMOhqPlqtns9ws5YenEq+Owv0XOSBVPQnELQrpW01TGQLVqvR8LL0aFnwtBvrzLR+mho+2VbSCciv5irC2j1fTzH3sGYtRb3MUL3ovCOYN3kBjxvAoqxfz6I1psiw.unVP7bcw0s7HNcz.yNOTX8U3J296HtjMzCKuB801mrpCTHbD4TTJUJuTEE04uW1r28te7VOZwVRarvpYyBKDtdRlZcjtuTvDz1g.50F1s0L2v1d+ErzWkPLyAik06Czbj9XK68TpxMntDukr6Ov1BJjaNVyyghCl6BNjtFt.XVcnUaOCaqbyo6nc311dZNG2xzPm3LWdoNAM1Muj8de57Y+7rRvWnzz.AAUUPCP18n0R+u6dWokg4Qxq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gRf6H
The knob displays and rotates as expected but the arc is still not colored.
I'm trying to adapt to this logic:
https://github.com/christoph-hart/hise_laf_library/blob/main/Examples.md
As Warm and Drive are colored orange and blue, I would like to be able to draw a white arc, assigned by ".textColour" -
@Mighty23 I don't see anywhere in your snippet where you're drawing an arc.
-
@d-healey this is a version with the code posted in the main topic
HiseSnippet 4741.3oc6b0DabijclskorTa6Ldh8l.jCIbElrnkmdZSx9+0wia8qsxHI2VsFudWGCsTMqtaNhMYaR15mwvKLBP.lfffr43dauGfbH4zh8xbJI.6gMA6o81dJm2S4RBvj2qJ9SQ1rkZIKOFy.IAa0r9688d068pupXI0zwtMw001QHyraez.hPlqI15HKudK0SyvRXskExLiXSGhKwSXwiFn45RzExjYpGf0lY1KKP+52e+E0L0rZShJRP3I1FsIqaz2vKpzlM9DCSyU0zIaazmq0kZrVaaqkrMsGBHYJQYgAZs2SqKYSMrYWRTHyzqna3Y6zxSyi3Jj4xKZqeTqd1GXwZ+SLbM10jfOnHzBFHVwqZapiHFKUXodFl5MCzXWAXTZFo+Swz+aItggtQX4Q1gaPqPJpG71iLWJN7lJF7T3gmLG7RARY3fzkYP58Ea01wXfWTMHdtp3ZVdDmNZfYmGJr1Jbo+kaJtjMzBKuB801irpC7PXOxonTpTdoJJpye2rYuyc9jMezhsjVegUylElHb8jL05HcOofAnsCAzq0saqYtts8dKXouJgXlC5Kq06q4H8IV16pTkqScIdKY2efsE7Pt4XUOGJNXrK3P5Z3BfY0gVs8LrsxMmti1AaY6o4bTKSCchyb4k5DTY27R169Yye8ru75YkfuP4oAhBJrfFfs6d8rrJtycjVFFGIudDocAWntN1CszkHllFCbIr1zsfKhLzWKGN.61k8v72Mn9NfS5JrtjSa9TGbCKKhywOtFdj9rGURenelhbdI7eZOS84RejjJ8iEYe74wj6RZlsGZByATg6.lIztHoY00jH0w1gVrlS6HyiKXI8.Sj7cw92BexvpqjlmjrjiltglkaTiIfM5dRpR2VZCMudEZtF7ITE1WybHYSam9ZlFeNQmNTq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rIBBazbEZLelLALsgnPg+evc.WnB
-
-
@d-healey (quite) fixed!
laf.registerFunction("drawRotarySlider", function(g, obj) { var a = obj.area; // Draw the background ellipse g.setColour(obj.bgColour); g.fillEllipse(a); // Draw the inner ellipse g.setColour(obj.itemColour1); g.fillEllipse([10, 10, a[2] - 20, a[3] - 20]); // Calculate the rotation angle for the arc var start = 0; // Starting at 0 radians var end = 2 * Math.PI * obj.valueNormalized; // Ending at 2π radians for full rotation // Define the arc path var p1 = Content.createPath(); var arcThickness = 12; // Thickness of the arc var arcMargin = 8; // p1.addArc([arcMargin, arcMargin, a[2] - 2 * arcMargin, a[3] - 2 * arcMargin], start, end); // Draw the value arc with .textColour g.setColour(obj.textColour); g.drawPath(p1, PathStroke.curved, arcThickness); // Changed from strokePath to drawPath // Draw the needle g.rotate(end, [a[2] / 2, a[3] / 2]); g.setColour(obj.itemColour2); g.fillRect([a[2] / 2 - 8 / 2, 0, 8, 40]); });
HiseSnippet 1230.3ocsW0maaaCEWxIpnwasXEXG.h7WxCdN1NYIAvnXIwwdvHeYDmUTffrBZIJYNSSJPQkTugBri1tA6JrivtAaORIKYO6klXf4hVv2m7G+oGeO19RgGINVHsr25loQDK6uzYvTtZT6QXJ2p2oV1u14BbrhHQopNYZDNNl3aYauwOnUXu0lVle+02eBlg4djBUVVuSP8HmSmPUEZ6ezYTFqK1mbCcxbdu2Q87D71BlHAvyFN0shvdiwgjKwZ2J4XY+hN9TkPNPgUjXvmSD9SGLR7.O0+2QioCYDsPCqAPhRUa0dDk42e1YM1xxdy9Em7MRO4esyETeZt9BF3qLFPEQLOGXW5wfTimAjrmCRalBo23LvSRiTEVz34Kb5wgOHAXfpmGJo9ZU58NNsEfGbUsI3wjtRPHOB28qWuJB9mJsZUt7N6b1kWcx.z4G2sLv8wJz8XI5LtXXiCPuEMKMgDUawjHAGDb2N071UZMWHLbvb96II.abtvCyNWHFeL2uKgvbgHJCNVSRBo5RptIbOEUvc21Whe3ZgBKmNfQ8IxsqhBlY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05e.SOUr4
now I "just" have to resize the inner ellipse and find a way to calculate the right arcMargin
-
@Mighty23 The arc margin and the arc thickness are the values you want to play with. I believe the thickness should be the same as your ellipse x/y value (10) and the margin should be half of this (5).
-
@d-healey done, final version:
//KNOBS LAF const var Knob17 = Content.getComponent("Knob17"); const var laf = Content.createLocalLookAndFeel(); laf.registerFunction("drawRotarySlider", function(g, obj) { var a = obj.area; // Draw the background ellipse g.setColour(obj.bgColour); g.fillEllipse(a); // Draw the inner ellipse (smaller) g.setColour(obj.itemColour1); var innerMargin = 20; // Increase this value to make the inner ellipse smaller g.fillEllipse([a[0] + innerMargin, a[1] + innerMargin, a[2] - 2*innerMargin, a[3] - 2*innerMargin]); // Calculate the rotation angle for the arc var start = 0; // Starting at 0 radians var end = 2 * Math.PI * obj.valueNormalized; // Ending at 2π radians for full rotation // Define the arc path var p1 = Content.createPath(); var arcThickness = 12; // Thickness of the arc var arcMargin = 8; // p1.addArc([arcMargin, arcMargin, a[2] - 2 * arcMargin, a[3] - 2 * arcMargin], start, end); // Draw the value arc with .textColour g.setColour(obj.textColour); g.drawPath(p1, 0, arcThickness); // Modified line with 3 arguments // Draw the needle g.rotate(end, [a[2] / 2, a[3] / 2]); g.setColour(obj.itemColour2); g.fillRect([a[2] / 2 - 8 / 2, 0, 8, 40]); }); Knob17.setLocalLookAndFeel(laf);
-
-
-
-