構文 | canvas.drawText( 文字列, GX, GY, 文字サイズ, 文字色[,背景色] ) |
説明 | メイン画面に一行の文字を書きます。 |
引数 | 文字列 : 表示する文字です。 GX : 表示開始X座標 GY : 表示開始Y座標 文字サイズ: 文字フォントサイズ 文字色 : 文字の色コード 背景色 : 文字背景の色コード 背景色を省略したときは背景なしとなります。文字は随時、実画面に表示されます。 |
戻り値 | なし |
------------------------------------------
-- 文字描画(canvas.drawText) サンプル drawText_sample.lua
------------------------------------------
function main()
canvas.drawCls(color(255,255,255))
canvas.drawText("構文:canvas.drawText( 文字列, GX, GY, 文字サイズ, 文字色[,背景色] )", 0, 0, 14, color(255,0,0))
canvas.drawText("ABC", 0, 16, 14, color(0,0,0) ,color(192,192,192))
canvas.drawText("DEF", 0, 32, 28, color(0,0,255))
canvas.drawText("GHI", 0, 62, 56, color(255,0,255))
canvas.drawText("画面タッチで終了します", 0,120, 24, color(0,0,0))
touch(3)
end
main()