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.
Paul, bit of a longshot but have you tried posting this in the bugtracker as a suggestion for 2.5?
Hi Paul_Boland! If you using active object as text blitter, then you can changes animation frames for different fonts with saving rotate position for this. I really cant understand you, them you cant do it, but I think this is hard method and cross platform, working on any platform, such as Android, iOS and Windows Phone 8.
Ok, just now I have opened MMF and looked at Text Blitter again. I can not see any way to change the font of the text at runtime. Also, I can't see any way to rotate a Text Blitter Object, there is no rotate controls in the Event Editor for it.
The font has to be changeable by the user at runtime. I don't know how often the user will change the font and what fonts they will use. Here is the video showing how I have implemented it into DigiGraph 3 using String Objects.
http://www.youtube.com/watch?v=q2kRn...dTHmQKJ-ubfQeQ
Danny, I'll pop it in there but it isn't really a bug, just something I would like to be able to do.
Paul_Boland, there is a feature request section for almost every product in the bugbox. That is what Danny was talking about.
I've popped it in there, thanks.
My suggestion would be putting the text on a separate layer and rotating that. Is it absolutely essential the text shares a layer with other objects?
I wish people would stop recommending blitting the text for this scenario. 90% of the time, text blitting is a superior choice, but for this (where the user can change to whatever font they want) it is not practical or even possible.
Right now all user added text is appearing on Layer 19. If I rotate that layer, all text on it will rotate. I can't see a way to create layers dynamically at runtime. So the only option is to add a whole host of redundant empty layers and add Strings to them one at a time, but then the question is, how many redundant layers do I create??? I don't know how many text objects the user will create at runtime. So for now, I'm keep text horizontal and I'm happy enough with that. Thanks though.