GameMaker Replace "▯" with something else

E

Erikku901

Guest
Hi all,
Thanks for this amazing community. There is so much valuable info to find here.

Anyway, I'm struggling with displaying text right now.
We take names from another API and show them ingame, however when that name is in Arabic, Korean, Chinese or using some other characters that aren't in my font, it will show as ▯(the famous Unicode character 9647) on PC and it will just disappear on mobile.

How can I change it so that it shows something else instead of ▯ on both PC and mobile?
Example:
Name:
伊藤
Shown now(PC):
▯▯
Shown now (Mobile):

How I want it to be shown:
**

Any suggestions would be greatly appreciated.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Personally, what I'd do is use sprite fonts and then substitute that character for another one in the sprite itself. With sprite fonts you can define exactly what characters are included by supplying a string with them in the order that they are shown in the sprite, so you simply add the ▯ character into the string and then make an image for it in the font sprite.

https://docs2.yoyogames.com/index.h..._gml_reference/fonts/font_add_sprite_ext.html
 
E

Erikku901

Guest
Thank you for your reply.
While it does work on PC. For some reason the whole ▯ character gets ignored on mobile.
(I'm playing it through a browser in html5 btw)
Couldn't seem to find anything about this in the manual either.
Are these differences between mobile and PC known?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
I honestly don't know whether this is just one of those differences between OS or whether it should consistently show the same symbol on all platforms. But like I say, if you want to be consistent and show the same symbol on all platforms, you should go with a sprite font. I would also suggest that you file a bug with the helpdesk, as at least you'll find out whether that's just the way it is or something that can be fixed!
 
E

Erikku901

Guest
Thank you.
I'm already using a sprite font as you suggested.
I'll file a bug report.
 
L

Lonewolff

Guest
I found the same thing when following the 'Space Rocks' you tube tutorials at the start of January.

Where ever the new lines were added, if the text was tabbed for code formatting it inserted ▯▯ at the start of every line. Didn't matter what font I tried. Made the code look messy if the text was bunched up at character position 0.

So I just went old school and manually formatted the draw_text calls.
 
Top