Package | org.as3utils |
Class | public class DrawUtil |
Inheritance | DrawUtil Object |
Method | Defined By | ||
---|---|---|---|
DrawUtil()
DrawUtil is a static class and shouldn't be instantiated. | DrawUtil | ||
border(bounds:Rectangle, thickness:Number = 1, color:uint = 0xFFFFFF, alpha:Number = 1):Shape [static] | DrawUtil | ||
circ(x:Number, y:Number, radius:Number, color:uint = 0xFFFFFF, alpha:Number = 1):Shape [static]
Returns a Shape object using the Shape.Graphics.drawCircle method. | DrawUtil | ||
rect(x:Number, y:Number, w:Number, h:Number, color:uint = 0xFFFFFF, alpha:Number = 1):Shape [static]
Returns a Shape object using the Shape.Graphics.drawRect method. | DrawUtil |
DrawUtil | () | Constructor |
public function DrawUtil()
DrawUtil is a static class and shouldn't be instantiated.
IllegalOperationError — DrawUtil is a static class and shouldn't be instantiated.
|
border | () | method |
public static function border(bounds:Rectangle, thickness:Number = 1, color:uint = 0xFFFFFF, alpha:Number = 1):Shape
Parameters
bounds:Rectangle | |
thickness:Number (default = 1 )
| |
color:uint (default = 0xFFFFFF )
| |
alpha:Number (default = 1 )
|
Shape |
circ | () | method |
public static function circ(x:Number, y:Number, radius:Number, color:uint = 0xFFFFFF, alpha:Number = 1):Shape
Returns a Shape
object using the Shape.Graphics.drawCircle
method.
Parameters
x:Number — the x location of the center of the circle relative to the registration point of the Shape object (in pixels).
| |
y:Number — the y location of the center of the circle relative to the registration point of the Shape object (in pixels).
| |
radius:Number — the radius of the circle (in pixels).
| |
color:uint (default = 0xFFFFFF ) — the color of the Shape .
| |
alpha:Number (default = 1 ) — the alpha of the Shape .
|
Shape — a Shape object using the Shape.Graphics.drawCircle method.
|
import flash.display.Shape; import org.as3coreaddendum.utils.DrawUtil; var s:Shape = DrawUtil.circ(0, 0, 50, 0xFF0000); addChild(s);
rect | () | method |
public static function rect(x:Number, y:Number, w:Number, h:Number, color:uint = 0xFFFFFF, alpha:Number = 1):Shape
Returns a Shape
object using the Shape.Graphics.drawRect
method.
Parameters
x:Number — a number indicating the horizontal position relative to the registration point of the Shape object (in pixels).
| |
y:Number — a number indicating the vertical position relative to the registration point of the Shape object (in pixels).
| |
w:Number — the width of the Shape (in pixels).
| |
h:Number — the height of the Shape (in pixels).
| |
color:uint (default = 0xFFFFFF ) — the color of the Shape .
| |
alpha:Number (default = 1 ) — the alpha of the Shape .
|
Shape — a Shape object using the Shape.Graphics.drawRect method.
|
import flash.display.Shape; import org.as3coreaddendum.utils.DrawUtil; var s:Shape = DrawUtil.rect(0, 0, 250, 250, 0xFF0000); addChild(s);