Packagejp.nium.utils
Classpublic final class GraphicUtil

GraphicUtil クラスは、グラフィック描画操作のためのユーティリティクラスです。



Public Methods
 MethodDefined by
  
drawCircle(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, radius:Number = 100.0):Sprite
[static] 円を描画します。 Draws a circle.
GraphicUtil
  
drawEllipse(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0):Sprite
[static] 楕円を描画します。 Draws an ellipse.
GraphicUtil
  
drawRect(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0):Sprite
[static] 矩形を描画します。 Draws a rectangle.
GraphicUtil
  
drawRoundRect(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0, ellipseWidth:Number = 20.0, ellipseHeight:Number):Sprite
[static] 角丸矩形を描画します。 Draws a rounded rectangle.
GraphicUtil
  
drawRoundRectComplex(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0, topLeftRadius:Number = 10.0, topRightRadius:Number = 10.0, bottomLeftRadius:Number = 10.0, bottomRightRadius:Number = 10.0):Sprite
[static] 角丸矩形を描画します。 Draws a rounded rectangle.
GraphicUtil
Method detail
drawCircle()method
public static function drawCircle(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, radius:Number = 100.0):Sprite

円を描画します。 Draws a circle.

Parameters
target:Sprite描画対象となる Sprite です。
 
color:int (default = -1)描画する色です。
 
alpha:Number (default = 1.0)描画するアルファです。
 
x:Number (default = 0.0)親表示オブジェクトの基準点からの円の中心の相対 x 座標(ピクセル単位)です。 The x location of the center of the circle relative to the registration point of the parent display object (in pixels).
 
y:Number (default = 0.0)親表示オブジェクトの基準点からの円の中心の相対 y 座標(ピクセル単位)です。 The y location of the center of the circle relative to the registration point of the parent display object (in pixels).
 
radius:Number (default = 100.0)円の半径(ピクセル単位)です。 The radius of the circle (in pixels).

Returns
Spritetarget パラメータで渡す Sprite インスタンスです。 The Sprite instance that you pass in the target parameter.

Example
   

drawEllipse()method 
public static function drawEllipse(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0):Sprite

楕円を描画します。 Draws an ellipse.

Parameters
target:Sprite描画対象となる Sprite です。
 
color:int (default = -1)描画する色です。
 
alpha:Number (default = 1.0)描画するアルファです。
 
x:Number (default = 0.0)親表示オブジェクトの基準点からの楕円の境界ボックスの左上の相対 x 座標(ピクセル単位)です。 The x location of the top-left of the bounding-box of the ellipse relative to the registration point of the parent display object (in pixels).
 
y:Number (default = 0.0)親表示オブジェクトの基準点からの楕円の境界ボックスの左上の相対 y 座標(ピクセル単位)です。 The y location of the top left of the bounding-box of the ellipse relative to the registration point of the parent display object (in pixels).
 
width:Number (default = 100.0)楕円の幅(ピクセル単位)です。 The width of the ellipse (in pixels).
 
height:Number (default = 100.0)楕円の高さ(ピクセル単位)です。 The height of the ellipse (in pixels).

Returns
Spritetarget パラメータで渡す Sprite インスタンスです。 The Sprite instance that you pass in the target parameter.

Example
   

drawRect()method 
public static function drawRect(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0):Sprite

矩形を描画します。 Draws a rectangle.

Parameters
target:Sprite描画対象となる Sprite です。
 
color:int (default = -1)描画する色です。
 
alpha:Number (default = 1.0)描画するアルファです。
 
x:Number (default = 0.0)親表示オブジェクトの基準点からの相対的な水平座標を示す数値(ピクセル単位)です。 A number indicating the horizontal position relative to the registration point of the parent display object (in pixels).
 
y:Number (default = 0.0)親表示オブジェクトの基準点からの相対的な垂直座標を示す数値(ピクセル単位)です。 A number indicating the vertical position relative to the registration point of the parent display object (in pixels).
 
width:Number (default = 100.0)矩形の幅(ピクセル単位)です。 The width of the rectangle (in pixels).
 
height:Number (default = 100.0)矩形の高さ(ピクセル単位)です。 The height of the rectangle (in pixels).

Returns
Spritetarget パラメータで渡す Sprite インスタンスです。 The Sprite instance that you pass in the target parameter.

Example
   

drawRoundRect()method 
public static function drawRoundRect(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0, ellipseWidth:Number = 20.0, ellipseHeight:Number):Sprite

角丸矩形を描画します。 Draws a rounded rectangle.

Parameters
target:Sprite描画対象となる Sprite です。
 
color:int (default = -1)描画する色です。
 
alpha:Number (default = 1.0)描画するアルファです。
 
x:Number (default = 0.0)親表示オブジェクトの基準点からの相対的な水平座標を示す数値(ピクセル単位)です。 A number indicating the horizontal position relative to the registration point of the parent display object (in pixels).
 
y:Number (default = 0.0)親表示オブジェクトの基準点からの相対的な垂直座標を示す数値(ピクセル単位)です。 A number indicating the vertical position relative to the registration point of the parent display object (in pixels).
 
width:Number (default = 100.0)角丸矩形の幅(ピクセル単位)です。 The width of the round rectangle (in pixels).
 
height:Number (default = 100.0)角丸矩形の高さ(ピクセル単位)です。 The height of the round rectangle (in pixels).
 
ellipseWidth:Number (default = 20.0)丸角の描画に使用される楕円の幅(ピクセル単位)です。 The width of the ellipse used to draw the rounded corners (in pixels).
 
ellipseHeight:Number丸角の描画に使用される楕円の高さ(ピクセル単位)。 (オプション)値を指定しない場合は、ellipseWidth パラメータに指定された値がデフォルトで適用されます。 The height of the ellipse used to draw the rounded corners (in pixels). Optional; if no value is specified, the default value matches that provided for the ellipseWidth parameter.

Returns
Spritetarget パラメータで渡す Sprite インスタンスです。 The Sprite instance that you pass in the target parameter.

Example
   

drawRoundRectComplex()method 
public static function drawRoundRectComplex(target:Sprite, color:int = -1, alpha:Number = 1.0, x:Number = 0.0, y:Number = 0.0, width:Number = 100.0, height:Number = 100.0, topLeftRadius:Number = 10.0, topRightRadius:Number = 10.0, bottomLeftRadius:Number = 10.0, bottomRightRadius:Number = 10.0):Sprite

角丸矩形を描画します。 Draws a rounded rectangle.

Parameters
target:Sprite描画対象となる Sprite です。
 
color:int (default = -1)描画する色です。
 
alpha:Number (default = 1.0)描画するアルファです。
 
x:Number (default = 0.0)親表示オブジェクトの基準点からの相対的な水平座標を示す数値(ピクセル単位)です。 A number indicating the horizontal position relative to the registration point of the parent display object (in pixels).
 
y:Number (default = 0.0)親表示オブジェクトの基準点からの相対的な垂直座標を示す数値(ピクセル単位)です。 A number indicating the vertical position relative to the registration point of the parent display object (in pixels).
 
width:Number (default = 100.0)角丸矩形の幅(ピクセル単位)です。 The width of the round rectangle (in pixels).
 
height:Number (default = 100.0)角丸矩形の高さ(ピクセル単位)です。 The height of the round rectangle (in pixels).
 
topLeftRadius:Number (default = 10.0)左上の楕円サイズです。
 
topRightRadius:Number (default = 10.0)右上の楕円サイズです。
 
bottomLeftRadius:Number (default = 10.0)左下の楕円サイズです。
 
bottomRightRadius:Number (default = 10.0)右下の楕円サイズです。

Returns
Spritetarget パラメータで渡す Sprite インスタンスです。 The Sprite instance that you pass in the target parameter.

Example