Packagexp.graphics
Classpublic class GraphicUtils



Public Properties
 PropertyDefined by
  nullStroke : Stroke
[static]
GraphicUtils
Public Methods
 MethodDefined by
  
beginFill(g:Graphics, fill:* = 0, rc:Rectangle = null):void
[static]
GraphicUtils
  
drawRoundRect(graphics:Graphics, rc:RoundRectangle):void
[static] Draws a rounded rectangle using the size of a radius to draw the rounded corners.
GraphicUtils
  
endFill(g:Graphics, fill:*):void
[static]
GraphicUtils
  
horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix
[static] Utility function to create a horizontal gradient matrix.
GraphicUtils
Protected Methods
 MethodDefined by
  
rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix
[static] Utility function to create a rotated gradient matrix.
GraphicUtils
  
verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix
[static] Utility function to create a vertical gradient matrix.
GraphicUtils
Property detail
nullStrokeproperty
public static var nullStroke:Stroke
Method detail
beginFill()method
public static function beginFill(g:Graphics, fill:* = 0, rc:Rectangle = null):voidParameters
g:Graphics
 
fill:* (default = 0)
 
rc:Rectangle (default = null)
drawRoundRect()method 
public static function drawRoundRect(graphics:Graphics, rc:RoundRectangle):void

Draws a rounded rectangle using the size of a radius to draw the rounded corners. You must set the line style, fill, or both on the Graphics object before you call the drawRoundRectComplex() method by calling the linestyle(), lineGradientStyle(), beginFill(), beginGradientFill(), or beginBitmapFill() method. This routine has been optimised for corners with 0 radius.

Parameters
graphics:Graphics — The Graphics object that draws the rounded rectangle.
 
rc:RoundRectangle — A rectangle object describing the position relative to the registration point of the parent display object, in pixels, and the size of the round rectangle, in pixels.
endFill()method 
public static function endFill(g:Graphics, fill:*):voidParameters
g:Graphics
 
fill:*
horizontalGradientMatrix()method 
public static function horizontalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix

Utility function to create a horizontal gradient matrix.

Parameters
x:Number — The left edge of the gradient.
 
y:Number — The top edge of the gradient.
 
width:Number — The width of the gradient.
 
height:Number — The height of the gradient.

Returns
Matrix — The horizontal gradient matrix. This is a temporary object that should only be used for a single subsequent call to the drawRoundRect() method.
rotatedGradientMatrix()method 
protected static function rotatedGradientMatrix(x:Number, y:Number, width:Number, height:Number, rotation:Number):Matrix

Utility function to create a rotated gradient matrix.

Parameters
x:Number — The left edge of the gradient.
 
y:Number — The top edge of the gradient.
 
width:Number — The width of the gradient.
 
height:Number — The height of the gradient.
 
rotation:Number — The amount to rotate, in degrees.

Returns
Matrix — The horizontal gradient matrix. This is a temporary object that should only be used for a single subsequent call to the drawRoundRect() method.
verticalGradientMatrix()method 
protected static function verticalGradientMatrix(x:Number, y:Number, width:Number, height:Number):Matrix

Utility function to create a vertical gradient matrix.

Parameters
x:Number — The left edge of the gradient.
 
y:Number — The top edge of the gradient.
 
width:Number — The width of the gradient.
 
height:Number — The height of the gradient.

Returns
Matrix — The horizontal gradient matrix. This is a temporary object that should only be used for a single subsequent call to the drawRoundRect() method.