インターフェイス IGraphics
Namespace: GameCanvas
public interface IGraphicsプロパティ
BackgroundColor
Color BackgroundColor { get; set; }背景色
BorderColor
Color BorderColor { get; }キャンバス外に表示される帯の色
備考
ChangeBorderColor を呼び出すことで変更できます
CanvasSize
int2 CanvasSize { get; }キャンバス解像度
備考
ChangeCanvasSize を呼び出すことで変更できます
CircleResolution
int CircleResolution { get; set; }円の解像度
Color
Color Color { get; set; }描画色
CoordinateScope
CoordinateScope CoordinateScope { get; }PushCoordinate と PopCoordinate が自動的に呼び出されるスコープ
CornerRadius
float CornerRadius { get; set; }角丸の半径
CurrentCoordinate
float2x3 CurrentCoordinate { get; set; }現在の座標系(変換行列)
CurrentStyle
GcStyle CurrentStyle { get; set; }現在のスタイル
DeviceScreenSize
int2 DeviceScreenSize { get; }端末スクリーン解像度
Font
GcFont Font { get; set; }フォント種別
FontSize
int FontSize { get; set; }フォントサイズ
LineCap
GcLineCap LineCap { get; set; }描線の端点の形状
LineWidth
float LineWidth { get; set; }描線の太さ
RectAnchor
GcAnchor RectAnchor { get; set; }矩形のアンカー位置
StringAnchor
GcAnchor StringAnchor { get; set; }文字列のアンカー位置
StyleScope
StyleScope StyleScope { get; }PushStyle と PopStyle が自動的に呼び出されるスコープ
メソッド
CalcStringHeight(string)
float CalcStringHeight(in string str)文字列の縦幅を計算します
パラメーター
str— 文字列
戻り値
縦幅
CalcStringSize(string)
float2 CalcStringSize(in string str)文字列のサイズを計算します
パラメーター
str— 文字列
戻り値
サイズ
CalcStringWidth(string)
float CalcStringWidth(in string str)文字列の横幅を計算します
パラメーター
str— 文字列
戻り値
横幅
CanvasToScreenPoint(float2, float2)
void CanvasToScreenPoint(in float2 canvas, out float2 screen)キャンバス座標を端末スクリーン座標に変換します
パラメーター
canvas— 変換元 キャンバス座標screen— 変換後 端末スクリーン座標
CanvasToScreenPoint(float2, int2)
void CanvasToScreenPoint(in float2 canvas, out int2 screen)キャンバス座標を端末スクリーン座標に変換します
パラメーター
canvas— 変換元 キャンバス座標screen— 変換後 端末スクリーン座標
ChangeBorderColor(Color)
void ChangeBorderColor(in Color color)キャンバス外の帯の色を変更します
備考
既存キャンバスの描画内容は全て破棄されます
パラメーター
color— 新しい帯の色
ChangeCanvasSize(int2)
void ChangeCanvasSize(in int2 size)キャンバス解像度を変更します
備考
- 初期値は 720x1280 です
- ディスプレイ解像度と縦横比が異なる場合は、上下もしくは左右に帯がつきます
- 既存キャンバスの描画内容は全て破棄されます
パラメーター
size— 新しいキャンバス解像度
ClearCoordinate()
void ClearCoordinate()CurrentCoordinate をリセットします
ClearScreen()
void ClearScreen()キャンバスを BackgroundColor で塗りつぶします
ClearStyle()
void ClearStyle()CurrentStyle をリセットします
DrawCircle()
void DrawCircle()中抜きの円を描画します
DrawCircle(GcCircle)
void DrawCircle(in GcCircle circle)中抜きの円を描画します
パラメーター
circle— 円
DrawImage(GcImage, float2, float)
void DrawImage(in GcImage image, in float2 position, float degree = 0f)画像を描画します
パラメーター
image— 描画する画像position— 位置degree— 回転(度数法)
DrawImage(GcImage, GcRect)
void DrawImage(in GcImage image, in GcRect rect)画像を拡縮して描画します
パラメーター
image— 描画する画像rect— 画像をフィッティングする矩形領域
DrawImage(GcImage)
void DrawImage(in GcImage image)画像を描画します
パラメーター
image— 描画する画像
DrawLine()
void DrawLine()線を描画します
DrawLine(GcLine)
void DrawLine(in GcLine line)線を描画します
パラメーター
line— 線
DrawRect()
void DrawRect()矩形を線で描画します
DrawRect(GcRect)
void DrawRect(in GcRect rect)矩形を線で描画します
パラメーター
rect— 矩形
DrawRoundedRect()
void DrawRoundedRect()角丸矩形を線で描画します
DrawRoundedRect(GcRect, float)
void DrawRoundedRect(in GcRect rect, float cornerRadius)角丸矩形を線で描画します
パラメーター
rect— 二等辺三角形が収まる矩形cornerRadius— 角丸の半径
DrawRoundedRect(GcRect)
void DrawRoundedRect(in GcRect rect)角丸矩形を線で描画します
パラメーター
rect— 二等辺三角形が収まる矩形
DrawString(string, float2, float)
void DrawString(in string str, in float2 position, float degree = 0f)文字列を描画します
パラメーター
str— 描画する文字列position— 位置degree— 回転(度数法)
DrawString(string, GcRect)
void DrawString(in string str, in GcRect rect)文字列を拡縮して描画します
パラメーター
str— 描画する文字列rect— 文字列をフィッティングする矩形領域
DrawString(string)
void DrawString(in string str)文字列を描画します
パラメーター
str— 描画する文字列
DrawTexture(Texture, float2, float)
void DrawTexture(in Texture texture, in float2 position, float degree = 0f)テクスチャーを描画します
パラメーター
texture— 描画するテクスチャーposition— 位置degree— 回転(度数法)
DrawTexture(Texture, float2x3)
void DrawTexture(in Texture texture, in float2x3 matrix)テクスチャーを変形して描画します
パラメーター
texture— 描画するテクスチャーmatrix— アフィン変換行列
DrawTexture(Texture, GcRect)
void DrawTexture(in Texture texture, in GcRect rect)テクスチャーを拡縮して描画します
パラメーター
texture— 描画するテクスチャーrect— テクスチャーをフィッティングする矩形領域
DrawTexture(Texture)
void DrawTexture(in Texture texture)テクスチャーを描画します
パラメーター
texture— 描画するテクスチャー
FillCircle()
void FillCircle()円を塗りで描画します
FillCircle(GcCircle)
void FillCircle(in GcCircle circle)円を塗りで描画します
パラメーター
circle— 円
FillRect()
void FillRect()矩形を塗りで描画します
FillRect(GcRect)
void FillRect(in GcRect rect)矩形を塗りで描画します
パラメーター
rect— 矩形
FillRoundedRect()
void FillRoundedRect()角丸矩形を塗りで描画します
FillRoundedRect(GcRect, float)
void FillRoundedRect(in GcRect rect, float cornerRadius)角丸矩形を塗りで描画します
パラメーター
rect— 二等辺三角形が収まる矩形cornerRadius— 角丸の半径
FillRoundedRect(GcRect)
void FillRoundedRect(in GcRect rect)角丸矩形を塗りで描画します
パラメーター
rect— 二等辺三角形が収まる矩形
PopCoordinate()
void PopCoordinate()スタックから座標系(変換行列)を取り出し CurrentCoordinate に上書きします
PopStyle()
void PopStyle()スタックから描画スタイルを取り出し CurrentStyle に上書きします
PushCoordinate()
void PushCoordinate()CurrentCoordinate をスタックに保存します
PushStyle()
void PushStyle()CurrentStyle をスタックに保存します
RebuildFontTexture()
void RebuildFontTexture()フォントテクスチャ―を再生成します
備考
- テキスト描画が乱れた場合にのみ呼び出すことを想定しています
- 実際に再生成が行われるのは、この関数を呼び出した次のフレームの冒頭です
RotateCoordinate(float, float2)
void RotateCoordinate(in float degree, in float2 origin)座標系(変換行列)を指定した座標を中心に回転させます
パラメーター
degree— 回転量(度数法)origin— 回転中心
RotateCoordinate(float)
void RotateCoordinate(in float degree)座標系(変換行列)を回転させます
パラメーター
degree— 回転量(度数法)
ScaleCoordinate(float2)
void ScaleCoordinate(in float2 scaling)座標系(変換行列)を拡縮させます
パラメーター
scaling— 拡縮率
ScreenToCanvasPoint(float2, float2)
void ScreenToCanvasPoint(in float2 screen, out float2 canvas)端末スクリーン座標をキャンバス座標に変換します
パラメーター
screen— 変換元 端末スクリーン座標canvas— 変換後 キャンバス座標
ScreenToCanvasPoint(float2, int2)
void ScreenToCanvasPoint(in float2 screen, out int2 canvas)端末スクリーン座標をキャンバス座標に変換します
パラメーター
screen— 変換元 端末スクリーン座標canvas— 変換後 キャンバス座標
TranslateCoordinate(float2)
void TranslateCoordinate(in float2 translation)座標系(変換行列)を平行移動させます
パラメーター
translation— 移動量
