|
| | FontOld (const char *フォント名, int 大きさ, int 太さ=1, int 改行高さ=0) |
| | デフォルトコンストラクタ. More...
|
| |
| bool | Load (const char *フォント名, int 大きさ, int 太さ=1, int 改行高さ=0) |
| | メモリ上にフォントを作成する. More...
|
| |
| bool | Release () const |
| | フォントをメモリから開放する. More...
|
| |
| TTF_Font * | GetHandle () const |
| | フォントのハンドルを取得. More...
|
| |
|
Image | MakeImage (Color 文字色, bool 反転フラグ, VariadicStream 描画する文字列) const |
| | フォントから画像を生成
|
| |
| int | GetSize () const |
| | 大きさを取得. More...
|
| |
| int | Getthick () const |
| | 太さを取得. More...
|
| |
| int | GetDrawStringWidth (VariadicStream 幅を計算する文字列) const |
| | 描画時の幅を取得[DXLIB]. More...
|
| |
| bool | Draw (const Point &座標, const Color &描画色, const VariadicStream &描画する文字列, bool 反転フラグ=false) const override |
| | 文字を描画. More...
|
| |
| bool | DrawRotate (const Point &座標, double 拡大率, double 角度, const Color &描画色, const VariadicStream &描画する文字列, bool 反転フラグ=false) const override |
| | 文字を回転して描画. More...
|
| |
| bool | DrawExtend (const Point &座標, double X軸拡大率, double Y軸拡大率, const Color &描画色, const VariadicStream &描画する文字列, bool 反転フラグ=false) const override |
| | 拡大率を指定して文字を描画. More...
|
| |
旧フォントクラス.
毎回レンダリングするので遅い
bool SampleFont()
{
using namespace SDX;
Font fontA(SystemFont::Gothic, 9, 4,
false);
Font fontB(SystemFont::Mincho, 20, 4,
true);
ImagePack bmpNumber(
"data/number.png",10,10,1);
ImagePack bmpFont(
"data/font.png", 30, 10, 3);
fontA.SetImageS("0", &bmpNumber,10);
fontA.SetImageS("a", &bmpFont, 26);
fontA.SetImageS("A", &bmpFont, 26);
fontA.SetImage("×", bmpFont[26]);
fontA.SetImage("□", bmpFont[27]);
fontA.SetImage("○", bmpFont[28]);
fontA.SetImage("☆", bmpFont[29]);
double angle = 0;
{
angle += 0.02;
fontA.Draw({ 10 , 10 },
Color::White,
"Hello○\nこん☆にちは\n今日は1234");
fontB.Draw({ 10 , 200 },
Color::Blue,
"Hello○\nこん☆にちは\n今日は1234");
fontA.DrawRotate({ 300, 100 }, 1, angle,
Color::White,
false,
"文字の回転□\nてすと1234×");
fontB.DrawRotate({ 300, 200 }, 1, angle,
Color::White,
false,
"文字の回転□\nてすと1234×");
}
return true;
}