Hi Folks.
Is there a way to rotate a String Object?
Printable View
Hi Folks.
Is there a way to rotate a String Object?
A string object cannot be directly rotated, but there are other methods of displaying text you can rotate, for example a text blitter or surface object thats been pasted to
If you are using a HWA setting, you can apply a pixel shader to the string object to directly rotate it, but the formating for getting it to use a proper texture is... tricky. IE regardless of the object x/y dimensions, the texture depends on the lines of text. A one vertical line object will only be one vertical line tall in texture
Paul. The easiest I have seen is to use an active and echo the string and rotate the active. The only bummer is that you can not change it in real time.
Marv
Thanks for the replies. I need the text in the String to be dynamic and changing at run-time so using an Active Object wouldn't work. I'll take a look at the other methods mentioned, thanks.
Hi clickers! I have think about it. This is possibly but, you need using active object for text blitting. Every letter as animation frame and you can rotate this active object as you need them in runtime dynamically.
Thanks. Did a few tests... Text Blitter won't do as I have to be able to change the font at runtime. Also, rotating the layer won't work because the layer the text is on is shared with other stuff created dynamically at runtime. I've decided to just leave the text horizontal.
Hi Paul_Boland! This is really possibly, but you can create text blitter using active object as letters. Then you can rotate this object that you need this.
Thanks, Crayzorechos, but Text Blitter won't work for what I want because I need to be able to change the font at runtime and I can't do with with Text Blitter.
How many fonts do you need to change to/how often/with what hassle? The text blitter can load new fonts at runtime by loading a new image
Using a string object with a pixel shader is difficult if you aren't using a monospaced single font since the displayed texture has the X/Y size of the displayed string, not the string object's dimensions, so if you're changing the font at runtime, it becomes enormously difficult, even using something like the extension that predicts font string size values- you need to somehow buffer the Y size of a string based on its X length, which depends on the X:Y ratio of each font and is never exact
A text blitter, or rotating the entire layer, is definitely the way to go.