Module flower.Graphics
The DisplayObject that has graphics capabilities.
You can call in the method chain MOAIDraw.
Extends:
Info:
- Release: V3.0.0
- Author: Makoto
Functions
Graphics:init (width, height) | The constructor. |
Graphics:onDraw (index, xOff, yOff, xFlip, yFlip) | This is the function called when drawing. |
Graphics:drawCircle (x, y, r, steps) | Draw a circle. |
Graphics:drawEllipse (x, y, xRad, yRad, steps) | Draw an ellipse. |
Graphics:drawLine (...) | Draws a line. |
Graphics:drawPoints (...) | Draws a point. |
Graphics:drawRay (x, y, dx, dy) | Draw a ray. |
Graphics:drawRect (x0, y0, x1, y1) | Draw a rectangle. |
Graphics:drawCallback (callback) | Draw a callback. |
Graphics:fillCircle (x, y, r, steps) | Fill the circle. |
Graphics:fillEllipse (x, y, xRad, yRad, steps) | Fill an ellipse. |
Graphics:fillFan (...) | Fills the triangle. |
Graphics:fillRect (x0, y0, x1, y1) | Fill a rectangle. |
Graphics:setPenColor (r, g, b, a) | Sets the color of the pen. |
Graphics:setPenWidth (width) | Set the size of the pen that you specify. |
Graphics:setPointSize (size) | Set the size of the specified point. |
Graphics:clear () | Clears the drawing operations. |
Functions
- Graphics:init (width, height)
-
The constructor.
Parameters:
- width
- height
- Graphics:onDraw (index, xOff, yOff, xFlip, yFlip)
-
This is the function called when drawing.
Parameters:
- index index of DrawCallback.
- xOff xOff of DrawCallback.
- yOff yOff of DrawCallback.
- xFlip xFlip of DrawCallback.
- yFlip yFlip of the Prop.
- Graphics:drawCircle (x, y, r, steps)
-
Draw a circle.
Parameters:
- x Position of the left.
- y Position of the top.
- r Radius.(Not in diameter.)
- steps Number of points.
Returns:
-
self
- Graphics:drawEllipse (x, y, xRad, yRad, steps)
-
Draw an ellipse.
Parameters:
- x Position of the left.
- y Position of the top.
- xRad Radius.(Not in diameter.)
- yRad Radius.(Not in diameter.)
- steps Number of points.
Returns:
-
self
- Graphics:drawLine (...)
-
Draws a line.
Parameters:
- ... Position of the points(x0, y0).
Returns:
-
self
- Graphics:drawPoints (...)
-
Draws a point.
Parameters:
- ... Position of the points(x0, y0).
Returns:
-
self
- Graphics:drawRay (x, y, dx, dy)
-
Draw a ray.
Parameters:
- x Position of the left.
- y Position of the top.
- dx Direction.
- dy Direction.
Returns:
-
self
- Graphics:drawRect (x0, y0, x1, y1)
-
Draw a rectangle.
Parameters:
- x0 Position of the left.
- y0 Position of the top.
- x1 Position of the right.
- y1 Position of the bottom
Returns:
-
self
- Graphics:drawCallback (callback)
-
Draw a callback.
Parameters:
- callback callback function.
Returns:
-
self
- Graphics:fillCircle (x, y, r, steps)
-
Fill the circle.
Parameters:
- x Position of the left.
- y Position of the top.
- r Radius.(Not in diameter.)
- steps Number of points.
Returns:
-
self
- Graphics:fillEllipse (x, y, xRad, yRad, steps)
-
Fill an ellipse.
Parameters:
- x Position of the left.
- y Position of the top.
- xRad Radius.(Not in diameter.)
- yRad Radius.(Not in diameter.)
- steps Number of points.
Returns:
-
self
- Graphics:fillFan (...)
-
Fills the triangle.
Parameters:
- ... Position of the points(x0, y0).
Returns:
-
self
- Graphics:fillRect (x0, y0, x1, y1)
-
Fill a rectangle.
Parameters:
- x0 Position of the left.
- y0 Position of the top.
- x1 Position of the right.
- y1 Position of the bottom.
Returns:
-
self
- Graphics:setPenColor (r, g, b, a)
-
Sets the color of the pen.
Will be reflected in the drawing functions.
Parameters:
- r red
- g green
- b blue
- a alpha
Returns:
-
self
- Graphics:setPenWidth (width)
-
Set the size of the pen that you specify.
Will be reflected in the drawing functions.
Parameters:
- width width
Returns:
-
self
- Graphics:setPointSize (size)
-
Set the size of the specified point.
Will be reflected in the drawing functions.
Parameters:
- size
Returns:
-
self
- Graphics:clear ()
-
Clears the drawing operations.
Returns:
-
self