Skip to content

インターフェイス IGraphics

Namespace: GameCanvas

csharp
public interface IGraphics

プロパティ

BackgroundColor

csharp
Color BackgroundColor { get; set; }

背景色

BorderColor

csharp
Color BorderColor { get; }

キャンバス外に表示される帯の色

備考

ChangeBorderColor を呼び出すことで変更できます

CanvasSize

csharp
int2 CanvasSize { get; }

キャンバス解像度

備考

ChangeCanvasSize を呼び出すことで変更できます

CircleResolution

csharp
int CircleResolution { get; set; }

円の解像度

Color

csharp
Color Color { get; set; }

描画色

CoordinateScope

csharp
CoordinateScope CoordinateScope { get; }

PushCoordinatePopCoordinate が自動的に呼び出されるスコープ

CornerRadius

csharp
float CornerRadius { get; set; }

角丸の半径

CurrentCoordinate

csharp
float2x3 CurrentCoordinate { get; set; }

現在の座標系(変換行列)

CurrentStyle

csharp
GcStyle CurrentStyle { get; set; }

現在のスタイル

DeviceScreenSize

csharp
int2 DeviceScreenSize { get; }

端末スクリーン解像度

Font

csharp
GcFont Font { get; set; }

フォント種別

FontSize

csharp
int FontSize { get; set; }

フォントサイズ

LineCap

csharp
GcLineCap LineCap { get; set; }

描線の端点の形状

LineWidth

csharp
float LineWidth { get; set; }

描線の太さ

RectAnchor

csharp
GcAnchor RectAnchor { get; set; }

矩形のアンカー位置

StringAnchor

csharp
GcAnchor StringAnchor { get; set; }

文字列のアンカー位置

StyleScope

csharp
StyleScope StyleScope { get; }

PushStylePopStyle が自動的に呼び出されるスコープ

メソッド

CalcStringHeight(string)

csharp
float CalcStringHeight(in string str)

文字列の縦幅を計算します

パラメーター

  • str — 文字列

戻り値

縦幅

CalcStringSize(string)

csharp
float2 CalcStringSize(in string str)

文字列のサイズを計算します

パラメーター

  • str — 文字列

戻り値

サイズ

CalcStringWidth(string)

csharp
float CalcStringWidth(in string str)

文字列の横幅を計算します

パラメーター

  • str — 文字列

戻り値

横幅

CanvasToScreenPoint(float2, float2)

csharp
void CanvasToScreenPoint(in float2 canvas, out float2 screen)

キャンバス座標を端末スクリーン座標に変換します

パラメーター

  • canvas — 変換元 キャンバス座標
  • screen — 変換後 端末スクリーン座標

CanvasToScreenPoint(float2, int2)

csharp
void CanvasToScreenPoint(in float2 canvas, out int2 screen)

キャンバス座標を端末スクリーン座標に変換します

パラメーター

  • canvas — 変換元 キャンバス座標
  • screen — 変換後 端末スクリーン座標

ChangeBorderColor(Color)

csharp
void ChangeBorderColor(in Color color)

キャンバス外の帯の色を変更します

備考

既存キャンバスの描画内容は全て破棄されます

パラメーター

  • color — 新しい帯の色

ChangeCanvasSize(int2)

csharp
void ChangeCanvasSize(in int2 size)

キャンバス解像度を変更します

備考

  • 初期値は 720x1280 です
  • ディスプレイ解像度と縦横比が異なる場合は、上下もしくは左右に帯がつきます
  • 既存キャンバスの描画内容は全て破棄されます

パラメーター

  • size — 新しいキャンバス解像度

ClearCoordinate()

csharp
void ClearCoordinate()

CurrentCoordinate をリセットします

ClearScreen()

csharp
void ClearScreen()

キャンバスを BackgroundColor で塗りつぶします

ClearStyle()

csharp
void ClearStyle()

CurrentStyle をリセットします

DrawCircle()

csharp
void DrawCircle()

中抜きの円を描画します

DrawCircle(GcCircle)

csharp
void DrawCircle(in GcCircle circle)

中抜きの円を描画します

パラメーター

  • circle — 円

DrawImage(GcImage, float2, float)

csharp
void DrawImage(in GcImage image, in float2 position, float degree = 0f)

画像を描画します

パラメーター

  • image — 描画する画像
  • position — 位置
  • degree — 回転(度数法)

DrawImage(GcImage, GcRect)

csharp
void DrawImage(in GcImage image, in GcRect rect)

画像を拡縮して描画します

パラメーター

  • image — 描画する画像
  • rect — 画像をフィッティングする矩形領域

DrawImage(GcImage)

csharp
void DrawImage(in GcImage image)

画像を描画します

パラメーター

  • image — 描画する画像

DrawLine()

csharp
void DrawLine()

線を描画します

DrawLine(GcLine)

csharp
void DrawLine(in GcLine line)

線を描画します

パラメーター

  • line — 線

DrawRect()

csharp
void DrawRect()

矩形を線で描画します

DrawRect(GcRect)

csharp
void DrawRect(in GcRect rect)

矩形を線で描画します

パラメーター

  • rect — 矩形

DrawRoundedRect()

csharp
void DrawRoundedRect()

角丸矩形を線で描画します

DrawRoundedRect(GcRect, float)

csharp
void DrawRoundedRect(in GcRect rect, float cornerRadius)

角丸矩形を線で描画します

パラメーター

  • rect — 二等辺三角形が収まる矩形
  • cornerRadius — 角丸の半径

DrawRoundedRect(GcRect)

csharp
void DrawRoundedRect(in GcRect rect)

角丸矩形を線で描画します

パラメーター

  • rect — 二等辺三角形が収まる矩形

DrawString(string, float2, float)

csharp
void DrawString(in string str, in float2 position, float degree = 0f)

文字列を描画します

パラメーター

  • str — 描画する文字列
  • position — 位置
  • degree — 回転(度数法)

DrawString(string, GcRect)

csharp
void DrawString(in string str, in GcRect rect)

文字列を拡縮して描画します

パラメーター

  • str — 描画する文字列
  • rect — 文字列をフィッティングする矩形領域

DrawString(string)

csharp
void DrawString(in string str)

文字列を描画します

パラメーター

  • str — 描画する文字列

DrawTexture(Texture, float2, float)

csharp
void DrawTexture(in Texture texture, in float2 position, float degree = 0f)

テクスチャーを描画します

パラメーター

  • texture — 描画するテクスチャー
  • position — 位置
  • degree — 回転(度数法)

DrawTexture(Texture, float2x3)

csharp
void DrawTexture(in Texture texture, in float2x3 matrix)

テクスチャーを変形して描画します

パラメーター

  • texture — 描画するテクスチャー
  • matrix — アフィン変換行列

DrawTexture(Texture, GcRect)

csharp
void DrawTexture(in Texture texture, in GcRect rect)

テクスチャーを拡縮して描画します

パラメーター

  • texture — 描画するテクスチャー
  • rect — テクスチャーをフィッティングする矩形領域

DrawTexture(Texture)

csharp
void DrawTexture(in Texture texture)

テクスチャーを描画します

パラメーター

  • texture — 描画するテクスチャー

FillCircle()

csharp
void FillCircle()

円を塗りで描画します

FillCircle(GcCircle)

csharp
void FillCircle(in GcCircle circle)

円を塗りで描画します

パラメーター

  • circle — 円

FillRect()

csharp
void FillRect()

矩形を塗りで描画します

FillRect(GcRect)

csharp
void FillRect(in GcRect rect)

矩形を塗りで描画します

パラメーター

  • rect — 矩形

FillRoundedRect()

csharp
void FillRoundedRect()

角丸矩形を塗りで描画します

FillRoundedRect(GcRect, float)

csharp
void FillRoundedRect(in GcRect rect, float cornerRadius)

角丸矩形を塗りで描画します

パラメーター

  • rect — 二等辺三角形が収まる矩形
  • cornerRadius — 角丸の半径

FillRoundedRect(GcRect)

csharp
void FillRoundedRect(in GcRect rect)

角丸矩形を塗りで描画します

パラメーター

  • rect — 二等辺三角形が収まる矩形

PopCoordinate()

csharp
void PopCoordinate()

スタックから座標系(変換行列)を取り出し CurrentCoordinate に上書きします

PopStyle()

csharp
void PopStyle()

スタックから描画スタイルを取り出し CurrentStyle に上書きします

PushCoordinate()

csharp
void PushCoordinate()

CurrentCoordinate をスタックに保存します

PushStyle()

csharp
void PushStyle()

CurrentStyle をスタックに保存します

RebuildFontTexture()

csharp
void RebuildFontTexture()

フォントテクスチャ―を再生成します

備考

  • テキスト描画が乱れた場合にのみ呼び出すことを想定しています
  • 実際に再生成が行われるのは、この関数を呼び出した次のフレームの冒頭です

RotateCoordinate(float, float2)

csharp
void RotateCoordinate(in float degree, in float2 origin)

座標系(変換行列)を指定した座標を中心に回転させます

パラメーター

  • degree — 回転量(度数法)
  • origin — 回転中心

RotateCoordinate(float)

csharp
void RotateCoordinate(in float degree)

座標系(変換行列)を回転させます

パラメーター

  • degree — 回転量(度数法)

ScaleCoordinate(float2)

csharp
void ScaleCoordinate(in float2 scaling)

座標系(変換行列)を拡縮させます

パラメーター

  • scaling — 拡縮率

ScreenToCanvasPoint(float2, float2)

csharp
void ScreenToCanvasPoint(in float2 screen, out float2 canvas)

端末スクリーン座標をキャンバス座標に変換します

パラメーター

  • screen — 変換元 端末スクリーン座標
  • canvas — 変換後 キャンバス座標

ScreenToCanvasPoint(float2, int2)

csharp
void ScreenToCanvasPoint(in float2 screen, out int2 canvas)

端末スクリーン座標をキャンバス座標に変換します

パラメーター

  • screen — 変換元 端末スクリーン座標
  • canvas — 変換後 キャンバス座標

TranslateCoordinate(float2)

csharp
void TranslateCoordinate(in float2 translation)

座標系(変換行列)を平行移動させます

パラメーター

  • translation — 移動量

Released under the MIT License.