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

Changing text color #25

Open
Cerzi opened this issue Oct 15, 2017 · 1 comment
Open

Changing text color #25

Cerzi opened this issue Oct 15, 2017 · 1 comment

Comments

@Cerzi
Copy link

Cerzi commented Oct 15, 2017

Can't find anything in documentation about this, and as far as I can tell Element.Text has no color attribute. Am I missing something here?

@niall-slater
Copy link

Bit late (sorry!) but I looked into this and it seems that Text uses a bitmap font (defined in kenneytheme\fonts and kenneytheme\kenney.json), which I think means you can't easily change colour on-the-fly.

I managed to get an alternate font colour by editing the .png file in \fonts. If you want to use multiple colours you'll need to add a line to kenney.json, but then you'll also need to specify which font you're using every time you create a Text object, otherwise the font won't render.

My first thought was that it doesn't default to the first one in the array, but line 89 in Text.js does exactly that. I'll have a look today and see if I can figure it out.

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

No branches or pull requests

2 participants