X-Planeの画面に直接テキストを描画する – FlyWithLua

最低限必要なのは、以下の3行。

function Text_draw()
–ここに記述していく
end
do_every_draw(“Text_draw()”)

function Text_draw()
	test_1 = 4.8
	test_2 = 5.3
	test_3 = -4.5
	test_4 = -5.3
	test_1 = math.floor(test_1)
	test_2 = math.floor(test_2)
	test_3 = math.floor(test_3)
	test_4 = math.floor(test_4)

	draw_string(100, 400, test_1, 0, 1, 0)
	draw_string(100, 380, test_2, 0, 1, 0)
	draw_string(100, 360, test_3, 0, 1, 0)
	draw_string(100, 340, test_4, 0, 1, 0)
end

do_every_draw("Text_draw()")

draw_string(x,y,”string”)
draw_string(x,y,”string”,”color”)
draw_string(x,y,”string”,red,green,blue)
draw_string_Helvetica_10(x,y,”string”)
draw_string_Helvetica_12(x,y,”string”)
draw_string_Helvetica_18(x,y,”string”)
draw_string_Times_Roman_10( x, y, “string” )
draw_string_Times_Roman_24( x, y, “string” )

measure_string(“string”)
measure_string(“string”,”fontname”)