Get text length in pixels?
-
I'm wondering if it's possible to get a reference to a length of text rendered on a panel?
So in this case:
g.drawAlignedText("Hello world", [0,0, this.getWidth(), this.getHeight()], "left");
...get to calculate the length of the "Hello world" text, and use that reference elsewhere?
-
const var s = Engine.getStringWidth("Hello world", "Comic Sans MS", 15.0, 0.05); Console.print(s);
https://docs.hise.audio/scripting/scripting-api/engine/index.html#getstringwidth
-
@Christoph-Hart perfect, thank you!