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

Text properties such as font and size no longer update after instantiation #435

Open
Jacic opened this issue Dec 29, 2016 · 3 comments
Open
Labels

Comments

@Jacic
Copy link
Contributor

Jacic commented Dec 29, 2016

  • HaxePunk version: current git version, but it likely affects 2.6.0 as well
  • Target(s): Tested on Linux
  • Haxe version: 3.2.1
  • OpenFL/Lime or NME version: Openfl 4.5.2 and Lime 3.5.2

I've run into a few issues when accessing and using properties on Text objects such as size or font. If I write for example

var t = new Text("Hello World");
t.font = "somefont.ttf";
t.size = 32;

The text will not actually have the correct size and font. The only way to set these is by using a TextFormat, or an anonymous TextFormat like this:

var t = new Text("Hello World", {font: "somefont.ttf"});

Obviously, this is less than ideal, but the larger issue is that modifying text properties after creation, which I do in my current projects, is not possible.

Additionally, the textWidth and textHeight properties do not work currently and always return 0, but that may or may not be related.

@bendmorris bendmorris added the bug label Dec 29, 2016
@bendmorris
Copy link
Member

Thanks. I was able to reproduce this on both native and Flash. It looks like we're updating the TextFormat correctly, but setTextFormat needs to be called on the TextField for it to actually reflect the changes.

@bendmorris
Copy link
Member

Leaving this open to look into textWidth/textHeight

@bendmorris bendmorris reopened this Dec 29, 2016
@Jacic
Copy link
Contributor Author

Jacic commented Jan 28, 2017

I've done some further investigating regarding the text properties, and while they are being set correctly on flash, they aren't being set correctly on native and html5. Some properties like color work, but size and align and probably others don't. However, the alpha property doesn't update correctly on flash, but does on native.

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

No branches or pull requests

2 participants