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