Show fallback glyph if its not present in the font, add Japanese font to TestGame.

This commit is contained in:
2025-06-29 16:21:34 +02:00
parent 9bc9810c8f
commit b3c1db3145
5 changed files with 66 additions and 5 deletions

View File

@@ -42,6 +42,11 @@ public class TestGame : Game
}
if (!ResourceManager.TryLoad("fonts/NotoSansJP-Regular.ttf", out _jpFont))
{
}
ResourceManager.TryLoad("icon.png", out _icon);
ResourceManager.TryLoad("sounds/test_sound_mono.ogg", out _sound);
@@ -73,7 +78,7 @@ public class TestGame : Game
if (Input.IsActionPressed("accept"))
{
_container.AddChild(new Label("Hello, World!", _font));
_container.AddChild(new Label("こんにちは世界!", _jpFont));
}
if (Input.IsActionPressed("cancel") && _container.Children.Count != 0)
@@ -120,6 +125,7 @@ public class TestGame : Game
private int _emitterId;
private ResourceRef<ParticleEmitterSettingsResource> _fireEffect;
private ResourceRef<Font> _font;
private ResourceRef<Font> _jpFont;
private ResourceRef<Sound> _sound;
private ResourceRef<Texture2d> _icon;