-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
Display.drawText throws an error in tiles mode #160
Comments
Well, this is kind of intentional. The |
Ok, it’s not surprising that it’s not supported (though it would be nice to
have). Maybe a check and better error message in case of tiles mode? I
could add that if you would accept a pull request.
…On Tue, Mar 19, 2019 at 2:26 AM Ondřej Žára ***@***.***> wrote:
Well, this is kind of intentional. The drawText is basically a bunch of
individual draw calls (for individual text letters). If you are unable to
do draw("H"), you will be unable to do drawText("Hello").
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#160 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA1-LCfYhICFdDiVE7Qk0F3-nFDRzdcHks5vYJEPgaJpZM4b6JS->
.
|
I am really not sure what would the proper behavior be, as I always considered drawing text with Tiles as undefined. Feel free to send a PR with better wording/handling, if you have a strong opinion on this. |
Hello @ondras, would it be possible to just display the letter like in the "forceSquareRatio:true"-mode with the fontSize set to tileHeight if the letter is not included in the tileMap? |
Hi @Gerhard-Wonner , I am afraid that a regular tile size is far too large to be a suitable drawing canvas for one letter. For a typical tile size of 32, the letter spacing would be too much for convenient reading. The recent webgl-related development is complicating this approach even further, because there is no straightforward way to render text into a webgl canvas. A suggestion (not tried, shall work): create your own tile atlas that includes both images and letters! Typically, you use a HTML |
@ondras Thank you for the detailed answer! :-) |
When working with tiles, drawText no longer functions:
yields:
Uncaught Error: Char "H" not found in tileMap
The text was updated successfully, but these errors were encountered: