Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label: text doesn't fit #1780

Open
CrazyFlasher opened this issue Dec 19, 2018 · 3 comments
Open

Label: text doesn't fit #1780

CrazyFlasher opened this issue Dec 19, 2018 · 3 comments

Comments

@CrazyFlasher
Copy link

CrazyFlasher commented Dec 19, 2018

Using TextFieldTextRenderer
Parent container uses AnchorLayout

Label properties:

label.wordWrap = true;
label.maxWidth = 300;
label.padding = 20;
label.paddingRight = 40;

var layoutData:AnchorLayoutData = new AnchorLayoutData();
layoutData:AnchorLayoutData.left = 0;

label.layoutData = layoutData:AnchorLayoutData ;
label.fontStyles = fonts.futuraPTMedium_0_32_left;

If I use text with line break, second line is not shown

Text:
Hello, Vitenka3533!\nI will guide you for the first time.

Screen:
image

Screen without line break - \n:
image

@joshtynjala
Copy link
Member

It's interesting that word wrap works correctly, but a line break does not.

Does it make a difference if you set the useGutter property to true on the TextFieldTextRenderer?

@CrazyFlasher
Copy link
Author

Unfortunately, setting useGutter to true didn't help in this case

@joshtynjala
Copy link
Member

In that case, I think it's probably a bug in flash.text.TextField. I've run into many over the years. Sometimes, it handles certain fonts better than others. If you switched to a different font, it might work.

Switching to TextBlockTextRenderer will probably work better too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants