1 #pragma once//©SDXFramework http://sourceforge.jp/projects/dxframework/
2 #include <Multimedia/Image.h>
3 #include <Framework/Anime.h>
4 #include <Multimedia/Font.h>
5 #include <Multimedia/Screen.h>
19 bool isAlphabetCapital;
24 int alphabetCapitalHeight;
25 int alphabetCapitalWidth;
27 int alphabetLowHeight;
38 isAlphabetCapital(
false),
48 return this->enterSpace;
55 this->enterSpace = 改行の高さ;
63 if( 数字用イメージ->
GetSize() < 10 )
return false;
65 divImageNumber = 数字用イメージ;
71 maxHeight = std::max( maxHeight , 数字用イメージ->
GetHeight() );
82 if( 大文字用イメージ->
GetSize() < 26 )
return false;
84 this->divImageAlphabetCapital = 大文字用イメージ;
86 this->alphabetCapitalWidth = 大文字用イメージ->
GetWidth();
87 this->alphabetCapitalHeight = 大文字用イメージ->
GetHeight();
88 this->spaceWidth = 大文字用イメージ->
GetWidth();
90 this->maxHeight = std::max(this->maxHeight, 大文字用イメージ->
GetHeight());
92 this->isAlphabetCapital =
true;
102 if( 小文字用イメージ->
GetSize() < 26 )
return false;
104 divImageAlphabetLow = 小文字用イメージ;
106 alphabetLowWidth = 小文字用イメージ->
GetWidth();
107 alphabetLowHeight = 小文字用イメージ->
GetHeight();
110 maxHeight = std::max( maxHeight, 小文字用イメージ->
GetHeight());
112 isAlphabetLow =
true;
122 for (
auto it : 描画する文字列.StringS)
126 int addY = this->maxHeight;
127 const char* bufstr = it.c_str();
129 while ( bufstr[a] != 0)
131 if (bufstr[a] >=
'0' && bufstr[a] <=
'9' && this->isNumber)
133 divImageNumber[0][bufstr[a] -
'0']->DrawExtend(
135 座標.y + addY - this->numberHeight },
136 { 座標.x + addX + this->numberWidth,
139 addX += this->numberWidth;
141 else if (bufstr[a] >=
'A' && bufstr[a] <=
'Z' && this->isAlphabetCapital)
144 divImageAlphabetCapital[0][bufstr[a] -
'A']->DrawExtend
147 座標.y + addY - this->alphabetCapitalHeight },
148 { 座標.x + addX + this->alphabetCapitalWidth,
152 addX += this->alphabetCapitalWidth;
155 else if (bufstr[a] >=
'a' && bufstr[a] <=
'z' && this->isAlphabetLow)
158 divImageAlphabetLow[0][bufstr[a] -
'a']->DrawExtend
161 座標.y + addY - this->numberHeight },
162 { 座標.x + addX + this->numberWidth,
166 addX += this->alphabetLowWidth;
169 else if ( bufstr[a] ==
' ')
174 if (a == strlen( bufstr ))
break;
176 addY += maxHeight + enterSpace;
192 for (
auto it : 描画する文字列.StringS)
196 int addY = this->maxHeight;
197 const char* bufstr = it.c_str();
201 while (bufstr[a] != 0)
203 if (bufstr[a] >=
'0' && bufstr[a] <=
'9' && this->isNumber)
206 this->divImageNumber[0][bufstr[a] -
'0']->DrawExtend
208 { 座標.x + int(addX * X拡大率),
209 座標.y + int((addY - this->numberHeight) * Y拡大率) },
210 { 座標.x + int((addX + this->numberWidth) * X拡大率),
211 座標.y + int(addY * Y拡大率) }
214 addX += this->numberWidth;
217 else if (bufstr[a] >=
'A' && bufstr[a] <=
'Z' && this->isAlphabetCapital)
220 this->divImageAlphabetCapital[0][bufstr[a] -
'A']->DrawExtend
222 { 座標.x + int(addX * X拡大率),
223 座標.y + int((addY - this->alphabetCapitalHeight) * Y拡大率) },
224 { 座標.x + int((addX + this->alphabetCapitalWidth) * X拡大率),
225 座標.y + int(addY * Y拡大率) }
228 addX += this->alphabetCapitalWidth;
231 else if (bufstr[a] >=
'a' && bufstr[a] <=
'z' && this->isAlphabetLow)
233 this->divImageAlphabetLow[0][bufstr[a] -
'a']->DrawExtend
235 { 座標.x + int(addX * X拡大率),
236 座標.y + int((addY - this->alphabetLowHeight) * Y拡大率) },
237 { 座標.x + int((addX + this->alphabetLowWidth) * X拡大率),
238 座標.y + int(addY * Y拡大率) }
241 addX += this->alphabetLowWidth;
243 else if (bufstr[a] ==
' ')
245 addX += this->spaceWidth;
248 if (a == strlen(bufstr))
break;
250 addY += this->maxHeight + this->enterSpace;
bool DrawRotate(const Point &座標, double 拡大率, double 角度, Color 描画色, bool 反転フラグ, VariadicStream 描画する文字列) const override
文字を回転して描画[未実装].
Definition: BmpFont.h:184
bool DrawExtend(const Point &座標, double X拡大率, double Y拡大率, Color 描画色, VariadicStream 描画する文字列) const override
拡大率を指定して文字を描画.
Definition: BmpFont.h:190
Font,BmpFont等のインターフェース.
Definition: IFont.h:9
int GetWidth() const
最大幅を取得.
Definition: ImagePack.h:107
static bool SetBright(Color 輝度)
描画輝度を設定.
Definition: Screen.h:149
点を表す図形クラス.
Definition: Shape.h:129
ビットマップフォントを表すクラス.
Definition: BmpFont.h:11
bool SetNumber(ImagePack *数字用イメージ)
数字フォントを設定.
Definition: BmpFont.h:61
bool SetAlphabetCapital(ImagePack *大文字用イメージ)
英大文字フォントをセット.
Definition: BmpFont.h:80
bool Draw(const Point &座標, Color 描画色, VariadicStream 描画する文字列) const override
書式付きで文字を描画.
Definition: BmpFont.h:117
色を表すクラス.
Definition: Color.h:7
int GetSize() const
要素数を取得.
Definition: ImagePack.h:101
可変数引数な文字列を処理するクラス.
Definition: VariadicStream.h:8
int GetHeight() const
最大高さを取得.
Definition: ImagePack.h:113
bool SetAlphabetLow(ImagePack *小文字用イメージ)
英小文字フォントをセット.
Definition: BmpFont.h:100
複数のImageをまとめるクラス.
Definition: ImagePack.h:9
int GetEnterHeight() const
改行の高さを取得.
Definition: BmpFont.h:46
void SetEnterHeight(int 改行の高さ)
改行の高さを設定.
Definition: BmpFont.h:53