Graphics, use to paint graphics contexts on a MovieClip.
new Graphics()
public function drawLine(p:Pen, x1:Number, y1:Number, x2:Number, y2:Number):Void
Draws a line. Between the points (x1, y1) and (x2, y2) in the target MovieClip.
p | the pen to draw |
x1 | the x corrdinate of the first point. |
y1 | the y corrdinate of the first point. |
x2 | the x corrdinate of the sencod point. |
y2 | the y corrdinate of the sencod point. |
public function drawPolygon(p:Pen, points:Array):Void
Draws a polygon. Start with the points[0] and end of the points[0] as a closed path.
p | the pen to draw |
points | the Array contains all vertex points in the polygon. |
public function fillPolygon(b:Brush, points:Array):Void
Fills a polygon. Start with the points[0] and end of the points[0] as a closed path.
b | the brush to fill. |
points | the Array contains all vertex points in the polygon. |
public function fillPolygonRing(b:Brush, points1:Array, points2:Array):Void
Fills a polygon ring.
b | the brush to fill. |
points1 | the first polygon's points. |
points2 | the second polygon's points. |
public function drawRectangle(pen:Pen, x:Number, y:Number, w:Number, h:Number):Void
Draws a rectange.
pen | the pen to draw. |
x | the left top the rectange bounds' x corrdinate. |
y | the left top the rectange bounds' y corrdinate. |
w | the width of rectange bounds. |
h | the height of rectange bounds. |
public function fillRectangle(brush:Brush, x:Number, y:Number, width:Number, height:Number):Void
Fills a rectange.
brush | the brush to fill. |
x | the left top the rectange bounds' x corrdinate. |
y | the left top the rectange bounds' y corrdinate. |
public function fillRectangleRing(brush:Brush, cx:Number, cy:Number, w1:Number, h1:Number, w2:Number, h2:Number):Void
Fills a rectange ring.
brush | the brush to fill. |
cx | the center of the ring's x corrdinate. |
cy | the center of the ring's y corrdinate. |
w1 | the first rectange's width. |
h1 | the first rectange's height. |
w2 | the second rectange's width. |
h2 | the second rectange's height. |
public function fillRectangleRingWithThickness(brush:Brush, x:Number, y:Number, w:Number, h:Number, t:Number):Void
Fills a rectange ring with specified thickness.
brush | the brush to fill. |
x | the left top the ring bounds' x corrdinate. |
y | the left top the ring bounds' y corrdinate. |
w | the width of ring periphery bounds. |
h | the height of ring periphery bounds. |
t | the thickness of the ring. |
public function drawCircle(p:Pen, cx:Number, cy:Number, radius:Number):Void
Draws a circle.
p | the pen to draw. |
cx | the center of the circle's x corrdinate. |
cy | the center of the circle's y corrdinate. |
radius | the radius of the circle. |
public function fillCircle(b:Brush, cx:Number, cy:Number, radius:Number):Void
Fills a circle.
b | the brush to draw. |
cx | the center of the circle's x corrdinate. |
cy | the center of the circle's y corrdinate. |
radius | the radius of the circle. |
public function fillCircleRing(b:Brush, cx:Number, cy:Number, r1:Number, r2:Number):Void
Fills a circle ring.
b | the brush to draw. |
cx | the center of the ring's x corrdinate. |
cy | the center of the ring's y corrdinate. |
r1 | the first circle radius. |
r2 | the second circle radius. |
public function fillCircleRingWithThickness(b:Brush, cx:Number, cy:Number, r:Number, t:Number):Void
Fills a circle ring with specified thickness.
b | the brush to draw. |
cx | the center of the ring's x corrdinate. |
cy | the center of the ring's y corrdinate. |
r | the radius of circle periphery. |
t | the thickness of the ring. |
public function drawEllipse(p:Pen, x:Number, y:Number, width:Number, height:Number):Void
Draws a ellipse.
x | the left top the ellipse bounds' x corrdinate. |
y | the left top the ellipse bounds' y corrdinate. |
public function fillEllipse(b:Brush, x:Number, y:Number, width:Number, height:Number):Void
Fills a rectange.
x | the left top the ellipse bounds' x corrdinate. |
y | the left top the ellipse bounds' y corrdinate. |
public function fillEllipseRing(brush:Brush, cx:Number, cy:Number, w1:Number, h1:Number, w2:Number, h2:Number):Void
Fill a ellipse ring.
brush | the brush to fill. |
cx | the center of the ring's x corrdinate. |
cy | the center of the ring's y corrdinate. |
w1 | the first eclipse's width. |
h1 | the first eclipse's height. |
w2 | the second eclipse's width. |
h2 | the second eclipse's height. |
public function fillEllipseRingWithThickness(brush:Brush, x:Number, y:Number, w:Number, h:Number, t:Number):Void
Fill a ellipse ring with specified thickness.
brush | the brush to fill. |
x | the left top the ring bounds' x corrdinate. |
y | the left top the ring bounds' y corrdinate. |
w | the width of ellipse periphery bounds. |
h | the height of ellipse periphery bounds. |
t | the thickness of the ring. |
public function drawRoundRect(pen:Pen, x:Number, y:Number, width:Number, height:Number, radius:Number, trR:Number, blR:Number, brR:Number):Void
Draws a round rectangle.
pen | the pen to draw. |
x | the left top the rectangle bounds' x corrdinate. |
y | the left top the rectangle bounds' y corrdinate. |
width | the width of rectangle bounds. |
height | the height of rectangle bounds. |
radius | the top left corner's round radius. |
trR | the top right corner's round radius. (miss this param default to same as radius) |
blR | the bottom left corner's round radius. (miss this param default to same as radius) |
brR | the bottom right corner's round radius. (miss this param default to same as radius) |
public function fillRoundRect(brush:Brush, x:Number, y:Number, width:Number, height:Number, radius:Number, trR:Number, blR:Number, brR:Number):Void
Fills a round rectangle.
brush | the brush to fill. |
x | the left top the rectangle bounds' x corrdinate. |
y | the left top the rectangle bounds' y corrdinate. |
width | the width of rectangle bounds. |
height | the height of rectangle bounds. |
radius | the top left corner's round radius. |
trR | the top right corner's round radius. (miss this param default to same as radius) |
blR | the bottom left corner's round radius. (miss this param default to same as radius) |
brR | the bottom right corner's round radius. (miss this param default to same as radius) |
public function fillRoundRectRing(brush:Brush, cx:Number, cy:Number, w1:Number, h1:Number, r1:Number, w2:Number, h2:Number, r2:Number):Void
Fill a round rect ring.
brush | the brush to fill |
cx | the center of the ring's x corrdinate |
cy | the center of the ring's y corrdinate |
w1 | the first round rect's width |
h1 | the first round rect's height |
r1 | the first round rect's round radius |
w2 | the second round rect's width |
h2 | the second round rect's height |
r2 | the second round rect's round radius |
public function fillRoundRectRingWithThickness(brush:Brush, x:Number, y:Number, w:Number, h:Number, r:Number, t:Number, ir:Number):Void
Fill a round rect ring with specified thickness.
brush | the brush to fill |
x | the left top the ring bounds' x corrdinate |
y | the left top the ring bounds' y corrdinate |
w | the width of ring periphery bounds |
h | the height of ring periphery bounds |
r | the round radius of the round rect |
t | the thickness of the ring |
ir | the inboard round radius, default is r-t
|
public function curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number):Void