Font fallbacks.

This commit is contained in:
2025-06-29 16:51:06 +02:00
parent b3c1db3145
commit 26cb66dbe0
6 changed files with 113 additions and 7 deletions

View File

@@ -54,6 +54,8 @@ public class TestGame : Game
{
throw new Exception("Failed to load emitter settings!");
}
_defaultFontSet = new([_font, _jpFont]);
}
protected override void Ready()
@@ -78,7 +80,7 @@ public class TestGame : Game
if (Input.IsActionPressed("accept"))
{
_container.AddChild(new Label("こんにちは世界!", _jpFont));
_container.AddChild(new Label("こんにちは世界!", _defaultFontSet));
}
if (Input.IsActionPressed("cancel") && _container.Children.Count != 0)
@@ -126,6 +128,9 @@ public class TestGame : Game
private ResourceRef<ParticleEmitterSettingsResource> _fireEffect;
private ResourceRef<Font> _font;
private ResourceRef<Font> _jpFont;
private FontSet _defaultFontSet;
private ResourceRef<Sound> _sound;
private ResourceRef<Texture2d> _icon;