-
-
Notifications
You must be signed in to change notification settings - Fork 899
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
feat: Added ability to render spritesheet-based fonts #1634
feat: Added ability to render spritesheet-based fonts #1634
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! I have one suggestion though.
TextPaint
is an immutable class IIRC, and for consistency I think we should that on this renderer too, so instead of a addGlyph
method, we could have a new attribute on the constructor to receive the metadata of mapped glyphs. Other than that, this looks great!
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, glad to see that the T-Rex game is already getting improvements too!
I agree with Erick's suggestions too.
We could make something like Need to keep an eye on future ability of create new |
I don't think that making this immutable would disallow that, we can take TextStyle from flutter itself as an example, where it provides a copyWith method, that same approach would work great on this too IMO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can't wait to use this.
Description
This PR adds [SpriteFontRenderer], which is a new implementation of [TextRenderer], allowing to render text based on fonts embedded into a spritesheet.
See the T-Rex game example, where the score is now rendered based on a spritesheet font.
(Also added highscore tracking for the TRex game).
Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.Breaking Change
Related Issues
Closes #1621