icubic library reference
Graphicsでパスを描画
概要
Graphicsオブジェクトを使ってパスを描画します

Graphicsでパスを描画
Graphicsを作成してSurfaceを設定する
パスオブジェクトを作り三角形を設定します

//Graphicsオブジェクトの作成
iGraphics_gp graphics = CreateGraphics();
graphics->SetSurface( surface );


背景を塗りつぶす
背景を灰色で塗りつぶす。背景を塗りつぶす場合、BlenderはOnezeroを使う。

//ペイントの作成と設定
graphics->SetPaint( (iPaint_gp)CreatePaintSolid( rgba( 220 , 220 , 220 ) ) );

//Blenderの作成と設定。背景の場合はOnezeroを使う
graphics->SetBlender( CreateBlender( Onezero_BlenderType_gp ) );

//塗りつぶし
graphics->PaintRect( 0 , faffine() );


パスを描画する
青色の楕円を描画します。

//Paint , Blenderの作成と設定
graphics->SetPaint( (iPaint_gp)CreatePaintSolid( rgba( 0 , 0 , 255 ) ) );
graphics->SetBlender( CreateBlender( Overlap_BlenderType_gp ) );

//楕円を描画する
graphics->PaintCircle( fvector2( 50.0f , 50.0f ) , 40.0f , 30.0f , faffine() );


Surfaceを解放する
GraphicsからSurfaceを解放します。

//Surfaceの解放
graphics->ReleaseSurface();


出力結果
サンプルの出力結果