Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-14-2009, 10:11 PM   #1
xemic
Registered User
 
Join Date: Jul 2009
Posts: 8
Default Making a TextField transformable [SOLVED]

Hello,

I have a Sprite and it has a TextField as a child. If that Sprite gets transformed, the TextField does not (at least not how I want it). One way to make it transformable is to turn it into a Bitmap. But when this Bitmap gets transformed, there is no anti-aliasing (or maybe little, it turns out ugly at least). Now I have two questions:
- is it possible to make it have some anti-aliasing?
- is there another way to make a TextField transformable?

Cheers!

EDIT: Yay for Google. Apparently I needed to have a swf have embedded a font and then use
Code:
[Embed(source="*location of the swf*", fontFamily="Georgia")]
and somewhere else:
Code:
var format:TextFormat = new TextFormat();
format.font = "Georgia";
text.embedFonts = true;
text.antiAliasType = AntiAliasType.ADVANCED;
text.defaultTextFormat = format;
Thanks for your help!

Last edited by xemic; 11-15-2009 at 12:47 PM. Reason: solved the problem myself
xemic is offline   Reply With Quote
Old 11-14-2009, 10:42 PM   #2
box86rowh
FLEX AND FLASH ARE COOL
 
Join Date: Oct 2005
Posts: 794
Default

I think you have to use an embedded font to do this
box86rowh is offline   Reply With Quote
Old 11-14-2009, 10:51 PM   #3
xemic
Registered User
 
Join Date: Jul 2009
Posts: 8
Default

How do I make a TextField use an embedded font with actionscript when that TextField is made with actionscript as well?
xemic is offline   Reply With Quote
Old 11-14-2009, 10:59 PM   #4
Muhammad1
Muhammad bin Yusrat
 
Join Date: Aug 2009
Location: Pakistan
Posts: 60
Send a message via Skype™ to Muhammad1
Default

Quote:
Originally Posted by xemic View Post
Hello,

I have a Sprite and it has a TextField as a child. If that Sprite gets transformed, the TextField does not (at least not how I want it). One way to make it transformable is to turn it into a Bitmap. But when this Bitmap gets transformed, there is no anti-aliasing (or maybe little, it turns out ugly at least). Now I have two questions:
- is it possible to make it have some anti-aliasing?
- is there another way to make a TextField transformable?

Cheers!

I think the event function that lets the users transform the text field should know the original size of the textfield, and when the user has resized it, you should accordingly calculate the new *font size* of the fonts and then reset the font size. That's how it happens in Photoshop if you resize the entire image. That way you won't loose anti-aliasing as well.
Muhammad1 is offline   Reply With Quote
Old 11-14-2009, 11:05 PM   #5
xemic
Registered User
 
Join Date: Jul 2009
Posts: 8
Default

Okay, what I actually have is a menu consisting of nodes rotating around a center point. Each node has text under it. Because of the rules of perspective, something that goes into the distance becomes smaller. The node is in fact a class based on a sprite, and it has a textfield as a child. Resizing the node resizes the textfield, but the size of the text inside 'snaps' to certain values which I presume are whole numbers, which looks ugly.
I want it to scale smoothly.

Muhammad, recalculating is not a solution. The sprite is scaled, and with that, automatically its textfield child.
xemic is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:48 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.