tags:

views:

26

answers:

3

Hi,

I'd like my text to be positioned on a 45 degree angle. Is there an easy way to do that? (In the worst case, I could always make a png out of the text). But, I hope that there's away to do it in Flex. I don't need an animated effect.

var angleText:Text= new Text;
angleText:Text.text = "My text is angled!"
angleText:Text.x= 200;
angleText:Text.y= 300;

Any suggestions?

Thank you.

-Laxmidi

+1  A: 

Try this tutorial. Take care to notice that you must use an embedded font or your rotated text will be invisible.

thenduks
Thank you for the link.
Laxmidi
+1  A: 

This is easy if you are using Flex 4. You do this by setting the "rotation" property to whatever angle in degrees (assuming you are using a Spark component, such as Label.) AND you don't need to embed a font to see it like you used to have to do in Flex 3.

Wade Mueller
Hi Wade, Thank you for the message. I need to upgrade at some point.
Laxmidi
+2  A: 

the Text in flex with System Fonts can not be rotated, go for embedded fonts,

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
 <mx:Style source="main.css"/>
 <mx:Text text="Ankur Sharma" top="50" left="50" fontSize="50" fontFamily="Arbeka" rotation="45"/>
</mx:Application>

You have to do something in CSS file as well, and that is this :

/* CSS file */
@font-face 
{
   src:url("Arbeka.swf");
    fontFamily: "Arbeka";
}

But here you need this Arbeka.swf file which i have created in Flash, this is actually we r embedding fonts. this also helps, if the client side doesn;t have supported fonts, then your flex application won't be facing font problem.

I don't know , how to to attach this file here, if you need this one, give me ur mail address, i'll send u,

i checked it it's working , take care, hav a gr8 time

i m still using flex3. Wade is right above. flex4 has lot more as compare to 3

Ankur Sharma
Hi Ankur Sharma, Thank you for your message.
Laxmidi