1 #pragma once//☀SDXFramework
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[i] != 0)
131 if (bufstr[i] >=
'0' && bufstr[i] <=
'9' && this->isNumber)
133 divImageNumber[0][bufstr[i] -
'0']->DrawExtend(
135 Y座標 + addY - this->numberHeight,
136 X座標 + addX + this->numberWidth,
139 addX += this->numberWidth;
141 else if (bufstr[i] >=
'A' && bufstr[i] <=
'Z' && this->isAlphabetCapital)
144 divImageAlphabetCapital[0][bufstr[i] -
'A']->DrawExtend
147 Y座標 + addY - this->alphabetCapitalHeight,
148 X座標 + addX + this->alphabetCapitalWidth,
152 addX += this->alphabetCapitalWidth;
155 else if (bufstr[i] >=
'a' && bufstr[i] <=
'z' && this->isAlphabetLow)
158 divImageAlphabetLow[0][bufstr[i] -
'a']->DrawExtend
161 Y座標 + addY - this->numberHeight,
162 X座標 + addX + this->numberWidth,
166 addX += this->alphabetLowWidth;
169 else if ( bufstr[i] ==
' ')
174 if (i == strlen( bufstr ))
break;
176 addY += maxHeight + enterSpace;
184 for (
auto it : 描画する文字列.StringS)
188 int addY = this->maxHeight;
189 const char* bufstr = it.c_str();
191 while (bufstr[i] != 0)
193 if (bufstr[i] >=
'0' && bufstr[i] <=
'9' && this->isNumber)
195 this->divImageNumber[0][bufstr[i] -
'0']->ZMaskExtend
198 Y座標 + addY - this->numberHeight,
199 X座標 + addX + this->numberWidth,
203 addX += this->numberWidth;
205 else if (bufstr[i] >=
'A' && bufstr[i] <=
'Z' && this->isAlphabetCapital)
208 this->divImageAlphabetCapital[0][bufstr[i] -
'A']->ZMaskExtend
211 Y座標 + addY - this->alphabetCapitalHeight,
212 X座標 + addX + this->alphabetCapitalWidth,
217 addX += this->alphabetCapitalWidth;
220 else if (bufstr[i] >=
'a' && bufstr[i] <=
'z' && this->isAlphabetLow)
223 this->divImageAlphabetLow[0][bufstr[i] -
'a']->ZMaskExtend
226 Y座標 + addY - this->numberHeight,
227 X座標 + addX + this->numberWidth,
232 addX += this->alphabetLowWidth;
235 else if (bufstr[i] ==
' ')
237 addX += this->spaceWidth;
240 if (i == strlen(bufstr))
break;
242 addY += this->maxHeight + this->enterSpace;
261 for (
auto it : 描画する文字列.StringS)
265 int addY = this->maxHeight;
266 const char* bufstr = it.c_str();
270 while (bufstr[i] != 0)
272 if (bufstr[i] >=
'0' && bufstr[i] <=
'9' && this->isNumber)
275 this->divImageNumber[0][bufstr[i] -
'0']->DrawExtend
277 X座標 +
int(addX * X拡大率),
278 Y座標 +
int((addY - this->numberHeight) * Y拡大率),
279 X座標 +
int((addX + this->numberWidth) * X拡大率),
280 Y座標 +
int(addY * Y拡大率)
283 addX += this->numberWidth;
286 else if (bufstr[i] >=
'A' && bufstr[i] <=
'Z' && this->isAlphabetCapital)
289 this->divImageAlphabetCapital[0][bufstr[i] -
'A']->DrawExtend
291 X座標 +
int(addX * X拡大率),
292 Y座標 +
int((addY - this->alphabetCapitalHeight) * Y拡大率),
293 X座標 +
int((addX + this->alphabetCapitalWidth) * X拡大率),
294 Y座標 +
int(addY * Y拡大率)
297 addX += this->alphabetCapitalWidth;
300 else if (bufstr[i] >=
'a' && bufstr[i] <=
'z' && this->isAlphabetLow)
302 this->divImageAlphabetLow[0][bufstr[i] -
'a']->DrawExtend
304 X座標 +
int(addX * X拡大率),
305 Y座標 +
int((addY - this->alphabetLowHeight) * Y拡大率),
306 X座標 +
int((addX + this->alphabetLowWidth) * X拡大率),
307 Y座標 +
int(addY * Y拡大率)
310 addX += this->alphabetLowWidth;
312 else if (bufstr[i] ==
' ')
314 addX += this->spaceWidth;
317 if (i == strlen(bufstr))
break;
319 addY += this->maxHeight + this->enterSpace;
328 for (
auto it : 描画する文字列.StringS)
332 int addY = this->maxHeight;
333 const char* bufstr = it.c_str();
335 while (bufstr[i] != 0)
337 if (bufstr[i] >=
'0' && bufstr[i] <=
'9' && this->isNumber)
340 this->divImageNumber[0][bufstr[i] -
'0']->ZMaskExtend
342 X座標 +
int(addX * X拡大率),
343 Y座標 +
int((addY - this->numberHeight) * Y拡大率),
344 X座標 +
int((addX + this->numberWidth) * X拡大率),
345 Y座標 +
int(addY * Y拡大率),
349 addX += this->numberWidth;
352 else if (bufstr[i] >=
'A' && bufstr[i] <=
'Z' && this->isAlphabetCapital)
355 this->divImageAlphabetCapital[0][bufstr[i] -
'A']->ZMaskExtend
357 X座標 +
int(addX * X拡大率),
358 Y座標 +
int((addY - this->alphabetCapitalHeight) * Y拡大率),
359 X座標 +
int((addX + this->alphabetCapitalWidth) * X拡大率),
360 Y座標 +
int(addY * Y拡大率),
364 addX += this->alphabetCapitalWidth;
367 else if (bufstr[i] >=
'a' && bufstr[i] <=
'z' && this->isAlphabetLow)
369 this->divImageAlphabetLow[0][bufstr[i] -
'a']->ZMaskExtend
371 X座標 +
int(addX * X拡大率),
372 Y座標 +
int((addY - this->alphabetLowHeight) * Y拡大率),
373 X座標 +
int((addX + this->alphabetLowWidth) * X拡大率),
374 Y座標 +
int(addY * Y拡大率),
378 addX += this->alphabetLowWidth;
380 else if (bufstr[i] ==
' ')
382 addX += this->spaceWidth;
385 if (i == strlen(bufstr))
break;
387 addY += this->maxHeight + this->enterSpace;
ZMaskType
Zマスクの種類.
Definition: Image.h:8
Font,BmpFont等のインターフェース.
Definition: IFont.h:9
int GetWidth() const
最大幅を取得.
Definition: ImagePack.h:107
static bool SetBright(Color 輝度)
描画輝度を設定.
Definition: Screen.h:153
ビットマップフォントを表すクラス.
Definition: BmpFont.h:11
bool SetNumber(ImagePack *数字用イメージ)
数字フォントを設定.
Definition: BmpFont.h:61
bool SetAlphabetCapital(ImagePack *大文字用イメージ)
英大文字フォントをセット.
Definition: BmpFont.h:80
bool Draw(int X座標, int Y座標, Color 描画色, VariadicStream 描画する文字列) const
書式付きで文字を描画.
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 ZMaskRotate(int X座標, int Y座標, double 拡大率, double 角度, ZMaskType Zマスクタイプ, bool 反転フラグ, VariadicStream 描画する文字列) const
文字を回転してマスク[未実装].
Definition: BmpFont.h:253
bool SetAlphabetLow(ImagePack *小文字用イメージ)
英小文字フォントをセット.
Definition: BmpFont.h:100
複数のImageをまとめるクラス.
Definition: ImagePack.h:9
bool ZMaskExtend(int X座標, int Y座標, double X拡大率, double Y拡大率, ZMaskType Zマスクタイプ, VariadicStream 描画する文字列) const
拡大率を指定して文字をマスク[DXLIB].
Definition: BmpFont.h:326
bool DrawExtend(int X座標, int Y座標, double X拡大率, double Y拡大率, Color 描画色, VariadicStream 描画する文字列) const
拡大率を指定して文字を描画.
Definition: BmpFont.h:259
bool ZMask(int X座標, int Y座標, ZMaskType Zマスクタイプ, VariadicStream 描画する文字列) const
文字をマスク[DXLIB].
Definition: BmpFont.h:182
bool DrawRotate(int X座標, int Y座標, double 拡大率, double 角度, Color 描画色, bool 反転フラグ, VariadicStream 描画する文字列) const
文字を回転して描画[未実装].
Definition: BmpFont.h:248
int GetEnterHeight() const
改行の高さを取得.
Definition: BmpFont.h:46
void SetEnterHeight(int 改行の高さ)
改行の高さを設定.
Definition: BmpFont.h:53