2 #include<Multimedia/SDX.h>
3 #include<Multimedia/Color.h>
4 #include<Multimedia/Image.h>
5 #include<Multimedia/Font.h>
6 #include<Utility/VariadicStream.h>
18 static Font defaultFont;
21 static void RGBACulculate(
int 赤 ,
int 緑 ,
int 青)
24 SDL_SetRenderDrawColor
34 static Image& circleTexture(
bool 塗りつぶしフラグ)
39 if (circleA.handle ==
nullptr)
42 font.
Load(SystemFont::Gothic, 1000);
44 SDL_Surface* surfaceA = TTF_RenderUTF8_Blended( font.
GetHandle(),
"●", {255,255,255,255});
46 circleA.part.w = surfaceA->w;
47 circleA.part.h = surfaceA->h;
48 SDL_FreeSurface(surfaceA);
50 SDL_Surface* surfaceB = TTF_RenderUTF8_Blended(font.
GetHandle(),
"○", { 255, 255, 255, 255 });
52 circleB.part.w = surfaceB->w;
53 circleB.part.h = surfaceB->h;
54 SDL_FreeSurface(surfaceB);
85 static bool Line(
int 始点X,
int 始点Y,
int 終点X,
int 終点Y,
Color 色,
int 太さ)
92 static bool Rect(
int 座標X,
int 座標Y,
int 幅,
int 高さ,
Color 色,
bool 塗りつぶしフラグ)
94 SDL_Rect buf = { 座標X, 座標Y, 幅, 高さ };
111 static bool Circle(
int 中心X,
int 中心Y,
int 半径,
Color 色,
bool 塗りつぶしフラグ)
114 circleTexture(塗りつぶしフラグ).
DrawExtend(中心X - 半径, 中心Y - 半径, 中心X + 半径, 中心Y + 半径);
126 static bool Oval(
int 中心X ,
int 中心Y ,
int 幅 ,
int 高さ ,
Color 色 ,
bool 塗りつぶしフラグ )
129 circleTexture(塗りつぶしフラグ).
DrawExtend(中心X - 幅/2, 中心Y - 高さ/2, 中心X + 幅/2, 中心Y + 高さ/2);
135 static bool Triangle(
int 頂点aX,
int 頂点aY,
int 頂点bX,
int 頂点bY,
int 頂点cX,
int 頂点cY,
Color 色,
bool 塗りつぶしフラグ)
155 return SDL_Color{ 0, 0, 0 };
160 static bool ImageFile(
int 座標X ,
int 座標Y ,
const char *ファイル名 ,
bool 透過フラグ =
true )
163 buf.
Draw(座標X , 座標Y ,
false);
172 defaultFont.
Draw(X座標,Y座標,色 , 描画する文字列 );
177 for (
auto it : 描画する文字列.StringS)
static void StringZMask(int X座標, int Y座標, ZMaskType Zマスク, VariadicStream 描画する文字列)
文字をマスク[DXLIB].
Definition: Drawing.h:175
ZMaskType
Zマスクの種類.
Definition: Image.h:8
int GetGreen() const
緑の要素を取得.
Definition: Color.h:31
static ColorData GetPixel(int 座標X, int 座標Y)
指定座標の色を取得[DXLIB].
Definition: Drawing.h:153
FontHandle GetHandle() const
フォントのハンドルを取得.
Definition: Font.h:64
static bool Circle(int 中心X, int 中心Y, int 半径, Color 色, bool 塗りつぶしフラグ)
中心と半径を指定して円を描画.
Definition: Drawing.h:111
int GetBlue() const
青の要素を取得.
Definition: Color.h:37
static Screen & Single()
シングルトンなインスタンスを取得.
Definition: Screen.h:42
リソースを読み込まずに描画を行う関数群.
Definition: Drawing.h:12
bool Draw(int X座標, int Y座標, bool 反転フラグ=false) const
指定座標に描画.
Definition: Image.h:163
static bool RectZMask(int 座標X, int 座標Y, int 幅, int 高さ, ZMaskType マスクタイプ, bool 塗りつぶしフラグ)
左上の座標と大きさを指定して矩形をマスク[DXLIB].
Definition: Drawing.h:104
フォントデータを表すクラス.
Definition: Font.h:23
static bool Rect(int 座標X, int 座標Y, int 幅, int 高さ, Color 色, bool 塗りつぶしフラグ)
左上の座標と大きさを指定して矩形を描画.
Definition: Drawing.h:92
static void SetDefaultFont(const char *フォント名, int 大きさ)
デフォルトのフォントを設定する.
Definition: Drawing.h:78
static bool CircleZMask(int 中心X, int 中心Y, int 半径, Color 色, bool 塗りつぶしフラグ)
中心と半径を指定して円をマスク[DXLIB].
Definition: Drawing.h:119
画像データを表すクラス.
Definition: Image.h:37
色を表すクラス.
Definition: Color.h:7
static bool Triangle(int 頂点aX, int 頂点aY, int 頂点bX, int 頂点bY, int 頂点cX, int 頂点cY, Color 色, bool 塗りつぶしフラグ)
頂点を3つ指定して三角形を描画.
Definition: Drawing.h:135
static void String(int X座標, int Y座標, Color 色, VariadicStream 描画する文字列)
文字を描画.
Definition: Drawing.h:170
bool Release() const
フォントをメモリから開放する.
Definition: Font.h:55
static bool Pixel(int 座標X, int 座標Y, Color 色)
指定座標に点を描画.
Definition: Drawing.h:145
bool Release()
イメージをメモリから開放.
Definition: Image.h:112
int GetRed() const
赤の要素を取得.
Definition: Color.h:25
可変数引数な文字列を処理するクラス.
Definition: VariadicStream.h:8
static bool ImageFile(int 座標X, int 座標Y, const char *ファイル名, bool 透過フラグ=true)
画像を一時的にメモリに読み込んで描画.
Definition: Drawing.h:160
static bool Oval(int 中心X, int 中心Y, int 幅, int 高さ, Color 色, bool 塗りつぶしフラグ)
中心と外接する四角形の大きさを指定して楕円を描画[DXLIB].
Definition: Drawing.h:126
static Font & GetFont()
デフォルトのフォントを取得する[SDL].
Definition: Drawing.h:72
bool DrawExtend(int X座標A, int Y座標A, int X座標B, int Y座標B) const
指定矩形内に描画.
Definition: Image.h:182
bool Draw(int X座標, int Y座標, Color 色, VariadicStream 描画する文字列) const
文字を描画.
Definition: Font.h:135
bool Load(const char *フォント名, int 大きさ, int 太さ=1, int 改行高さ=0, FontType フォントタイプ=FontType::Normal)
メモリ上にフォントを作成する.
Definition: Font.h:43
static bool Line(int 始点X, int 始点Y, int 終点X, int 終点Y, Color 色, int 太さ)
始点と終点を結ぶ直線を描画.
Definition: Drawing.h:85
static ScreenHandle GetHandle()
スクリーンハンドルを取得.
Definition: Screen.h:49