2025年12月23日火曜日

Haxe Flixel 2Dゲームエンジン 画像表示 日本語表示

https://haxeflixel.com/demos/

のデモを改造して学んでいます

kuondon0.1

画像表示


$flixel create Flixius

cp kuondon.png Fixius/image/kuondon.png

Fixius/source/Player.hx

loadGraphic(AssetPaths.kuondon__png, true);

// loadGraphic(AssetPaths.player__png, true, 16, 8)

うまくいった





 日本語表示

noto-fontsを/usr/share/fontsからassets/fonts/にコピーしてもうまくかなかった

VL-Gothic-Regularフォントもそのままの名前ではUnkown Identifiterなどと

出てうまくいかなかったが

cp VL-Gothic-Regular assets/fonts/V.ttfなどとし

AssetPaths.V__ttf指定するとうまく表示された

var text = new flixel.text.FlxText(0,0,0,"南無妙法蓮華経",64);

text.screenCenter();

text.color = 0x00FFFF;

text.setFormat(AssetPaths.V__ttf,24,0xFF00FF);

add(text);






0 件のコメント:

コメントを投稿