SDXFrameWork
0.10
SDXFrameWork
|
TrueTypeFontとBMPFontをまとめて扱うクラス. More...
#include <Font.h>
Inherits SDX::IFont.
Public Member Functions | |
Font (const char *フォント名, int 大きさ, int 行間=0, bool 高品質レンダリングフラグ=true) | |
コンストラクタ | |
bool | Load (const char *フォント名, int 大きさ, int 行間=0, bool 高品質レンダリングフラグ=true) |
フォントを作成する. More... | |
bool | Release () const |
フォントハンドルをメモリから開放する. More... | |
TTF_Font * | GetHandle () const |
フォントのハンドルを取得. More... | |
Image | MakeImage (Color 文字色, bool 反転フラグ, const VariadicStream &描画する文字列) const |
FontからImageを生成. More... | |
int | GetSize () const |
大きさを取得. More... | |
int | GetDrawStringWidth (const VariadicStream &幅を計算する文字列) const |
描画時の幅を取得. More... | |
bool | Draw (const Point &座標, const Color &描画色, const VariadicStream &描画する文字列, bool 反転フラグ=false) const override |
文字を描画. More... | |
bool | DrawShadow (const Point &座標, Color 表色, Color 影色, const VariadicStream &描画する文字列) const |
文字を影付きで描画. 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... | |
void | SetImage (const std::string &文字, Image *対応画像) |
指定した文字に対応するImageを設定. More... | |
void | SetImageS (const std::string &文字列, ImagePack *対応画像, int 登録数) |
指定した文字から連続してに対応するImageをまとめて設定. More... | |
TrueTypeFontとBMPFontをまとめて扱うクラス.
毎回レンダリングせず、ハッシュマップにImageを格納する 一度も表示していない文字が必要になった場合生成し以後使いまわす
bool SDX::Font::Load | ( | const char * | フォント名, |
int | 大きさ, | ||
int | 行間 = 0 , |
||
bool | 高品質レンダリングフラグ = true |
||
) |
フォントを作成する.
行間は0の場合、改行後の文字が上下くっつく。
BMPフォント専用にしたい場合、フォント名は無効な物を入れる
bool SDX::Font::Release | ( | ) | const |
フォントハンドルをメモリから開放する.
TTF_Font* SDX::Font::GetHandle | ( | ) | const |
フォントのハンドルを取得.
Image SDX::Font::MakeImage | ( | Color | 文字色, |
bool | 反転フラグ, | ||
const VariadicStream & | 描画する文字列 | ||
) | const |
FontからImageを生成.
int SDX::Font::GetSize | ( | ) | const |
大きさを取得.
int SDX::Font::GetDrawStringWidth | ( | const VariadicStream & | 幅を計算する文字列 | ) | const |
描画時の幅を取得.
|
overridevirtual |
bool SDX::Font::DrawShadow | ( | const Point & | 座標, |
Color | 表色, | ||
Color | 影色, | ||
const VariadicStream & | 描画する文字列 | ||
) | const |
文字を影付きで描画.
|
overridevirtual |
|
overridevirtual |
void SDX::Font::SetImage | ( | const std::string & | 文字, |
Image * | 対応画像 | ||
) |
指定した文字に対応するImageを設定.
文字列が2文字以上なら2文字目以降は無視
void SDX::Font::SetImageS | ( | const std::string & | 文字列, |
ImagePack * | 対応画像, | ||
int | 登録数 | ||
) |
指定した文字から連続してに対応するImageをまとめて設定.
例えば文字列="0"で登録数=10なら0~9までを登録 アルファベットや数字用