public final class Graphics
Package :
(default package)
Description :
Handles all graphic stuff : drawing lines, circles, rectangle... The idea is to store the Javascript instructions into a function array which will be executed every time a new drawing is needed.
Methods :
public final new(element)
Creates a new public final Graphics object.
Parameters :
- element : The owning DisplayObject.
private addPoint(x, y)
Adding a point to the Graphics object. This helps calculating the object's size.
Parameters :
- x :
- y :
public arc(x, y, r, start, end, way)
Drawing an arc.
Parameters :
- x : The x coordinate.
- y : The y coordinate.
- r : The arc's radius.
- start : The arc's starting angle.
- end : The arc's ending angle.
- way : The arc's drawing way (clockwise:false).
Returns :
The current Graphics object.
public beginBitmapFill(imageUrl)
Starting to fill with the specified image.
Parameters :
- imageUrl : The bitmap image's url.
Returns :
The current Graphics object.
public beginFill(color)
Starting to fill a shape with the specified color
Parameters :
- color : The color with which to fill.
Returns :
The current Graphics object.
public clear()
Clearing the graphics object.
Returns :
The current Graphics object.
public clip(x, y)
Clipping the drawing region to the drawn area.
Parameters :
- x : The x coordinate.
- y : The y coordinate.
Returns :
The current Graphics object.
public copy(graphics)
Parameters :
- graphics : The other Graphics object to follow.
Returns :
The current Graphics object.
public draw(context)
Drawing the graphics object : executing every stored instruction.
Parameters :
- context : The context to draw on.
public endFill(notLast)
Ending the current fill. If other shapes will be drawn after the current one, notLast should be set to true.
Parameters :
- notLast : Specifies if other shapes should be drawn after the current one.
Returns :
The current Graphics object.
public height()
Getting the graphical height.
Returns :
The height.
public image(imageUrl, The, The)
Drawing an image at the specified position.
Parameters :
- imageUrl : The image's URL.
- The : x coordinate.
- The : y coordinate.
Returns :
The current Graphics object.
public lineStyle(color, thickness)
Setting the linestyle
Parameters :
- color : The line color.
- thickness : The line thickness.
Returns :
The current Graphics object.
public lineTo(x, y)
Drawing a line from the cursor to the specified position.
Parameters :
- x : The x coordinate.
- y : The y coordinate.
Returns :
The current Graphics object.
public moveTo(x, y)
Moving the cursor to the specified position.
Parameters :
- x : The x coordinate.
- y : The y coordinate.
Returns :
The current Graphics object.
public rect(x, y, w, h)
Drawing a rectangle.
Parameters :
- x : The x coordinate.
- y : The y coordinate.
- w : The rectangle's width.
- h : The rectangle's height.
Returns :
The current Graphics object.
public shadowStyle(color, blur, x, y)
Setting the shadow style
Parameters :
- color : The shadow color
- blur : The shadow blur
- x : The shadow's x offset
- y : The shadow's y offset
Returns :
The current Graphics object.
public size()
Getting the number of functions to call to draw the entire Graphics object.
Returns :
The number of instructions.
public width()
Getting the graphical width.
Returns :
The width.