-
Notifications
You must be signed in to change notification settings - Fork 3
2D Shape
FYP edited this page Aug 9, 2017
·
1 revision
Shape shape = shape.new()
Creates new shape
object.
shape:draw(uint prim_type, bool enable_vertex_alpha, uint src_blend, uint dst_blend, [Texture texture])
shape:add_vertex(float x, float y, int r, int g, int b, int a, [float u, float v, bool invert_x, bool invert_y])
shape:set_vertex(uint index, float x, float y, int r, int g, int b, int a, [float u, float v, bool invert_x, bool invert_y])
shape:set_vertex(uint index, Vertex vertex)
shape:clear()
uint vertices = shape.vertices_number
bool result = shape:rotate_vertex(uint index, float around_x, float around_y, float angle)
bool result = shape:rotate_vertices_range(uint from, uint to, float around_x, float around_y, float angle)
bool result = shape:rotate_all_vertices(float around_x, float around_y, float angle)
Vertex vertex = shape:get_vertex(uint index)
Returns nil
on failure.
float x = vertex.x
float y = vertex.y
float z = vertex.z
float u = vertex.u
float v = vertex.v
float rhw = vertex.rhw
vertex:set_color(int r, int g, int b, int aя)
int r, int g, int b, int a = vertex:get_color()
ZERO
ONE
SRCCOLOR
INVSRCCOLOR
SRCALPHA
INVSRCALPHA
DESTALPHA
INVDESTALPHA
DESTCOLOR
INVDESTCOLOR
SRCALPHASAT
LINELIST
POLYLINE
TRIANGLELIST
TRIANGLESTRIP
TRIANGLEFAN
POINTLIST