Skip to content
FYP edited this page Aug 9, 2017 · 1 revision

Class shape

Static Members

shape.new

Shape shape = shape.new()

Creates new shape object.

Members

shape:draw

shape:draw(uint prim_type, bool enable_vertex_alpha, uint src_blend, uint dst_blend, [Texture texture])

shape:add_vertex

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

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

shape:clear()

shape.vertices_number

uint vertices = shape.vertices_number

shape:rotate_vertex

bool result = shape:rotate_vertex(uint index, float around_x, float around_y, float angle)

shape:rotate_vertices_range

bool result = shape:rotate_vertices_range(uint from, uint to, float around_x, float around_y, float angle)

shape:rotate_all_vertices

bool result = shape:rotate_all_vertices(float around_x, float around_y, float angle)

shape:get_vertex

Vertex vertex = shape:get_vertex(uint index)

Returns nil on failure.

Class vertex

Members

vertex.x

float x = vertex.x

vertex.y

float y = vertex.y

vertex.z

float z = vertex.z

vertex.u

float u = vertex.u

vertex.v

float v = vertex.v

vertex.rhw

float rhw = vertex.rhw

vertex:set_color

vertex:set_color(int r, int g, int b, int aя)

vertex:get_color

int r, int g, int b, int a = vertex:get_color()

Enums

blend_method

  • ZERO
  • ONE
  • SRCCOLOR
  • INVSRCCOLOR
  • SRCALPHA
  • INVSRCALPHA
  • DESTALPHA
  • INVDESTALPHA
  • DESTCOLOR
  • INVDESTCOLOR
  • SRCALPHASAT

primitive_type

  • LINELIST
  • POLYLINE
  • TRIANGLELIST
  • TRIANGLESTRIP
  • TRIANGLEFAN
  • POINTLIST