2 #include<Multimedia/SDX.h>
3 #include<Multimedia/Color.h>
4 #include<Multimedia/Image.h>
18 void RGBACulculate(
int 赤 ,
int 緑 ,
int 青)
const
20 SDL_SetRenderDrawBlendMode(Screen::GetHandle(), (SDL_BlendMode)Screen::Single().nowBlendMode);
21 SDL_SetRenderDrawColor
24 Screen::Single().rgba.GetRed() * 赤 / 255,
25 Screen::Single().rgba.GetGreen() * 緑 / 255,
26 Screen::Single().rgba.GetBlue() * 青 / 255,
27 Screen::Single().blendParam
34 static bool Line(
int 始点X,
int 始点Y,
int 終点X,
int 終点Y,
Color 色,
int 太さ)
37 return !DxLib::DrawLine( 始点X , 始点Y , 終点X , 終点Y , 色 , 太さ );
40 return !SDL_RenderDrawLine(Screen::GetHandle(), 始点X, 始点Y, 終点X, 終点Y);
45 static bool Rect(
int 座標aX,
int 座標aY,
int 座標bX,
int 座標bY,
Color 色,
bool 塗りつぶしフラグ)
48 return !DxLib::DrawBox( 座標aX , 座標aY , 座標bX , 座標bY , 色 , 塗りつぶしフラグ );
50 SDL_Rect buf = { 座標aX, 座標aY, 座標bX - 座標aX, 座標bY - 座標aY };
56 return !SDL_RenderFillRect(Screen::GetHandle(), &buf);
58 return !SDL_RenderDrawRect(Screen::GetHandle(), &buf);
62 static bool RectZMask(
int x1 ,
int y1 ,
int x2 ,
int y2 , ZMaskType type,
bool isFill )
65 return !DxLib::DrawBoxToZBuffer( x1 , y1 , x2 , y2 , isFill , (
int)type );
72 static bool Circle(
int 中心X,
int 中心Y,
int 半径,
Color 色,
bool 塗りつぶしフラグ)
75 return !DxLib::DrawCircle( 中心X , 中心Y , 半径 , 色 , 塗りつぶしフラグ );
82 static bool CircleZMask(
int 中心X,
int 中心Y,
int 半径,
Color 色,
bool 塗りつぶしフラグ)
85 return !DxLib::DrawCircleToZBuffer( 中心X , 中心Y , 半径 , 塗りつぶしフラグ , DX_ZWRITE_MASK );
92 static bool Oval(
int 中心X ,
int 中心Y ,
int 幅 ,
int 高さ ,
Color 色 ,
bool 塗りつぶしフラグ )
95 return !DxLib::DrawOval( 中心X , 中心Y , 幅 , 高さ , 色 , 塗りつぶしフラグ );
102 static bool Triangle(
int 頂点aX,
int 頂点aY,
int 頂点bX,
int 頂点bY,
int 頂点cX,
int 頂点cY, ColorData 色,
bool 塗りつぶしフラグ)
105 return !DxLib::DrawTriangle( 頂点aX , 頂点aY , 頂点bX , 頂点bY , 頂点cX , 頂点cY , 色 , 塗りつぶしフラグ);
115 return !DxLib::DrawPixel( 座標X , 座標Y , 色 );
118 SDL_RenderDrawPoint(Screen::GetHandle() ,座標X, 座標Y);
127 return DxLib::GetPixel( 座標X , 座標Y );
129 return SDL_Color{ 0, 0, 0 };
134 static bool ImageFile(
int 座標X ,
int 座標Y ,
const char *ファイル名 ,
bool 透過フラグ =
true )
138 return !DxLib::LoadGraphScreen( 座標X , 座標Y , ファイル名 , 透過フラグ);
141 buf.Draw(座標X , 座標Y ,
false);
148 static void String(
int X座標 ,
int Y座標 , Color 色 ,
const char *文字列 , ... )
154 vsprintf_s( bufstr , 1024 , 文字列 , args );
158 stro = strtok_s( bufstr ,
"\n" , &pstr );
163 DxLib::DrawString( X座標 , Y座標 , stro , 色 );
167 stro = strtok_s( NULL ,
"\n" , &pstr );
172 static void StringZMask(
int X座標 ,
int Y座標 , ZMaskType Zマスク ,
const char *文字列 , ... )
177 vsprintf_s( bufstr , 1024 , 文字列 , args );
181 stro = strtok_s( bufstr ,
"\n" , &pstr );
186 DxLib::DrawStringToZBuffer( X座標 , Y座標 , stro , (
int)Zマスク);
190 stro = strtok_s( NULL ,
"\n" , &pstr );
int GetGreen() const
緑の要素を取得.
Definition: Color.h:43
static ColorData GetPixel(int 座標X, int 座標Y)
指定座標の色を取得.
Definition: Drawing.h:124
static bool Circle(int 中心X, int 中心Y, int 半径, Color 色, bool 塗りつぶしフラグ)
中心と半径を指定して円を描画.
Definition: Drawing.h:72
int GetBlue() const
青の要素を取得.
Definition: Color.h:53
画像データを表すクラス.
Definition: Image.h:37
色を表すクラス.
Definition: Color.h:7
static bool Pixel(int 座標X, int 座標Y, Color 色)
指定座標に点を描画.
Definition: Drawing.h:112
int GetRed() const
赤の要素を取得.
Definition: Color.h:33
static void String(int X座標, int Y座標, Color 色, const char *文字列,...)
書式付きで文字を描画.
Definition: Drawing.h:149
static bool Rect(int 座標aX, int 座標aY, int 座標bX, int 座標bY, Color 色, bool 塗りつぶしフラグ)
座標aと座標bを対角の頂点とする矩形を描画.
Definition: Drawing.h:45
static bool ImageFile(int 座標X, int 座標Y, const char *ファイル名, bool 透過フラグ=true)
画像を一時的にメモリに読み込んで描画.
Definition: Drawing.h:135
static bool Oval(int 中心X, int 中心Y, int 幅, int 高さ, Color 色, bool 塗りつぶしフラグ)
中心と外接する四角形の大きさを指定して楕円を描画.
Definition: Drawing.h:92
static bool Line(int 始点X, int 始点Y, int 終点X, int 終点Y, Color 色, int 太さ)
始点と終点を結ぶ直線を描画.
Definition: Drawing.h:34
static bool Triangle(int 頂点aX, int 頂点aY, int 頂点bX, int 頂点bY, int 頂点cX, int 頂点cY, ColorData 色, bool 塗りつぶしフラグ)
頂点を3つ指定して三角形を描画.
Definition: Drawing.h:102