Scaleform Studio Lua API Reference: scaleform.physics.PolygonShape object reference
Represents a polygon shape with up to 8 sides.
This element inherits from:
Parameters Returns number |
The rotation angle.
|
Parameters Returns integer |
Number of vertices.
|
Parameters self : | scaleform.physics.PolygonShape |
The polygon shape to set as a box shape.
|
hw : | number |
The half width of the box.
|
hh : | number |
The half height of the box.
|
center : | scaleform.Point? |
The center of the box.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
angle : | number? |
The rotation angle of the box.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Returns | This function does not return any values. |
Parameters Returns | This function does not return any values. |
Parameters Returns | This function does not return any values. |
Parameters self : | scaleform.physics.PolygonShape |
The polygon shape to create.
|
points : | scaleform.Point[] |
Array of vertices in the shape, must have more than 2 points.
The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown. |
Returns | This function does not return any values. |
scaleform.physics.Shape
Represents shape used in fixtures.
scaleform.physics.PolygonShape.box_angle (self) : number
Returns rotation of box shape, shape have been initialize with set_as_box function.
self : scaleform.physics.PolygonShape
The polygon set as box shape.
number
scaleform.physics.PolygonShape
Represents a polygon shape with up to 8 sides.
A numeric value.
scaleform.physics.PolygonShape.box_height (self) : number
Returns half height of box shape, shape have been initialize with set_as_box function.
self : scaleform.physics.PolygonShape
The polygon set as box shape.
number
scaleform.physics.PolygonShape.box_width (self) : number
Returns half width of box shape, shape have been initialize with set_as_box function.
self : scaleform.physics.PolygonShape
The polygon set as box shape.
number
scaleform.physics.PolygonShape.centroid (self) : scaleform.Point
Returns the centroid of the polygon shape.
self : scaleform.physics.PolygonShape
The polygon shape in use.
scaleform.Point
The point set as centroid.
scaleform.Point
Point should be in the form of a table {x=a, y=b}
{ PropertyType : string, x : number, y : number, }
scaleform.physics.PolygonShape.num_vertices (self) : integer
Returns the number of vertices the shape has.
self : scaleform.physics.PolygonShape
The polygon shape in use.
integerA strictly integral numeric value, with no decimal component.
scaleform.physics.PolygonShape.set_as_box (self, hw, hh, center, angle)
Sets the parameters to turn a polygon into a box shape.
self : scaleform.physics.PolygonShape
The polygon shape to set as a box shape.
hw : number
The half width of the box.
hh : number
The half height of the box.
center : scaleform.Point?
The center of the box.The ? notation indicates that this type is optional: there may be zero or one instances of it.
angle : number?
The rotation angle of the box.The ? notation indicates that this type is optional: there may be zero or one instances of it.
scaleform.physics.PolygonShape.set_centroid (self, point)
Sets the centroid of the polygon shape.
self : scaleform.physics.PolygonShape
The polygon shape in use.
point : scaleform.Point
The center point set as centroid.
scaleform.physics.PolygonShape.set_vertex_by_index (self, index, point)
Sets a new vertex for the shape at the specified index.
self : scaleform.physics.PolygonShape
The polygon shape in use.
index : integer
The index at which a new vertex is inserted.
point : scaleform.Point
The vertex to be added.
scaleform.physics.PolygonShape.set_vertices (self, points)
Creates a polygon shape by setting vertices.
self : scaleform.physics.PolygonShape
The polygon shape to create.
points : scaleform.Point[]
Array of vertices in the shape, must have more than 2 points.The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
scaleform.physics.PolygonShape.vertex_by_index (self, index) : scaleform.Point
Returns the vertex of the shape at the specified index.
self : scaleform.physics.PolygonShape
The polygon shape in use.
index : integer
The index at which the vertex is returned.
scaleform.Point
The vertex at the specified index.A string of characters.Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.