02-10-2011 09:13 PM
I've got a basic label with some text that I want to make really big. But, it seems like there is some undocumented maximum size that I can make the label's text. Anything above around 300 pt. font seems to max out and revert back down to about 300 pt, regardless of how huge I make the bounding rectangle of the lablel.
Bug or feature? Is there a workaround?
Solved! Go to Solution.
02-10-2011 09:29 PM
there is a 127 pixel font limit on TextFormat's size. It has been there for a while. here is a link to more details:
if you do a test you'll see no matter what value you use past 127, it'll always be the same. hope that sheds some light. good luck!
02-10-2011 09:42 PM
Okay, well that solves the question as to why I couldn't make big text. But, the problem still remains. I tried scaling my Label using the .scaleX and .scaleY properties, but that just made it not show up at all.
Is there a way I can apply the Element Format to the qnx.ui.text.Label class?
02-10-2011 09:46 PM
the underlying object in a Label object is a TextField object. so using hte TextElement approach may not work. i did however get the scaleX and the scaleY to work. here is an example of the code i used:
[SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
public class LabelTest extends Sprite
public function LabelTest()
// support autoOrients
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
var format:TextFormat = new TextFormat();
format.font = "BBAlpha Sans";
format.size = 127;
var format2:TextFormat = new TextFormat();
format2.font = "BBAlpha Sans";
format2.size = 127;
var textmsg :Label = new Label();
textmsg.format = format;
textmsg.text = "My huge text";
textmsg.textField.scaleX = 2;
textmsg.textField.scaleY = 2;
textmsg.setSize( textmsg.textWidth + 5, textmsg.textHeight + 5 );
var controlLabel:Label = new Label();
controlLabel.format = format2;
controlLabel.text = "My huge text";
controlLabel.setSize( controlLabel.textWidth + 5, controlLabel.textHeight + 5 );
controlLabel.setPosition(0,textmsg.y + textmsg.height + 5);
i used two Labels. one where i resized and the other where did not. make sure to scale the inner textField object. hope that clears a few things up. good luck!
02-10-2011 09:49 PM - edited 02-10-2011 09:50 PM
Oh awesome! Thanks for your quick replies! I wasn't scaling the textField property of my label; just the label itself. Now it works like a charm!