引数名 | 初期値 | I/O | 詳細 |
text | - | In | 文字列。
指定した文字列の幅と高さを取得します。 |
width | - | Out | 文字列(text)の幅を返します
|
height | - | Out | 文字列(text)の高さを返します
|
void OnInit() { uint size_x,size_y; int fontsize; string out_text = "テスト"; fontsize = -100; TextSetFont("MS ゴシック",fontsize); // 描画メソッドのフォント設定(MSゴシック, 10.0pt) TextGetSize(out_text,size_x,size_y); printf("テキスト:【%s】(%dpt)の テキスト幅:%d[pixcel], テキスト高さ:%d[pixcel]", out_text,MathAbs(fontsize/10),size_x,size_y); fontsize = -200; TextSetFont("MS ゴシック",fontsize); // 描画メソッドのフォント設定(MSゴシック, 20.0pt) TextGetSize(out_text,size_x,size_y); printf("テキスト:【%s】(%dpt)の テキスト幅:%d[pixcel], テキスト高さ:%d[pixcel]", out_text,MathAbs(fontsize/10),size_x,size_y); }
テキスト:【テスト】(10pt)の テキスト幅:32[pixcel], テキスト高さ:13[pixcel] テキスト:【テスト】(20pt)の テキスト幅:66[pixcel], テキスト高さ:27[pixcel]