File hp/display/Mesh.lua
Functions
M.newCircle (left, top, r, col, seg) | Creates and returns a mesh of the circle. Mesh is the class that inherits from the DisplayObject. |
M.newGradient (col1, col2, angle) | Creates and returns a gradient array. Example: ( "#003300", "#CCFF00", 90 ) |
M.newPolygon (left, top, vertices, col) | Creates and returns a mesh of the polygon. Mesh is the class that inherits from the DisplayObject. |
M.newRect (left, top, width, height, col) | Creates and returns a mesh of the rectangle. Mesh is the class that inherits from the DisplayObject. |
M:init (vcoords, colors, primType, params) | The constructor. Normally, you do not directly create an instance. Creation function (M.newRect, M.newCircle, M.newPolygon) you can easily create a mesh by using the. |
calculateDetailedGradient (points, angle, col1, col2) | Returns the color to calculate the gradient. |
calculateGradient (color1, color2, angle, gradAngle) | Returns the color to calculate the gradient. |
createMesh (vcoords, colors, primType) | Creates and returns a mesh. |
isColorOrGradient (col) | Returns an array of colors. |
Tables
Mesh | This is a class to draw a gradient mesh. |
Functions
- M.newCircle (left, top, r, col, seg)
-
Creates and returns a mesh of the circle.
Mesh is the class that inherits from the DisplayObject.Parameters
- left: Position of the left.
- top: Position of the top.
- r: Radius.
- col: color(s).
- seg: segments.
Return value:
Circle object - M.newGradient (col1, col2, angle)
-
Creates and returns a gradient array.
Example: ( "#003300", "#CCFF00", 90 )Parameters
- col1: fromColor.
- col2: toColor.
- angle: gradientAngle.
Return value:
gradient array - M.newPolygon (left, top, vertices, col)
-
Creates and returns a mesh of the polygon.
Mesh is the class that inherits from the DisplayObject.Parameters
- left: Position of the left.
- top: Position of the top.
- vertices: Vertex array.
- col: Color gradient.
Return value:
Polygon object - M.newRect (left, top, width, height, col)
-
Creates and returns a mesh of the rectangle.
Mesh is the class that inherits from the DisplayObject.Parameters
- left: Position of the left.
- top: Position of the top.
- width: width.
- height: height.
- col: Color of the gradient.
Return value:
Rectangle object - M:init (vcoords, colors, primType, params)
-
The constructor.
Normally, you do not directly create an instance.
Creation function (M.newRect, M.newCircle, M.newPolygon) you can easily create a mesh by using the.Parameters
- vcoords:
- colors:
- primType:
-
params: (option)Parameter is set to Object.
(params:width, height)
- calculateDetailedGradient (points, angle, col1, col2)
-
Returns the color to calculate the gradient.
Parameters
- points:
- angle:
- col1:
- col2:
- calculateGradient (color1, color2, angle, gradAngle)
-
Returns the color to calculate the gradient.
Parameters
- color1:
- color2:
- angle:
- gradAngle:
- createMesh (vcoords, colors, primType)
-
Creates and returns a mesh.
Parameters
- vcoords:
- colors:
- primType:
- isColorOrGradient (col)
-
Returns an array of colors.
Parameters
- col: