Creates a polygonal game object.
Example
cfg.Game;
function OnLoad()
{
polygon = gfx.CreatePolygon( [0.2,0.6, 0.8,0.6, 0.5,0.2, 0.2,0.6], 0, 0, 0x33ff55, 6, 0xcc1122 );
}
function OnReady()
{
gfx.AddGraphic( polygon, 0.2, 0.7 );
gfx.Play();
}
Methods
The following methods are available on the Polygon object:
alpha →
Number: fraction (0..1)
angle →
Number: fraction (0..1)
height →
Number: fraction (0..1)
pivotX →
Number: fraction (0..1)
pivotY →
Number: fraction (0..1)
String
Number: hexadecimal 0xrrggbb
Number: fraction (0..1)
Number: pixel
Object: Matrix
List: [
x1,
y1,
x2,
y2, ... ]
The objects alpha value
The rotation fraction of the object
pol.Contains
Checks if a point is contained in the sprite
An object for saving individual extra properties.
the PIXI graphic
The objects group identifier
The height of the object
The x pivot for rotations
The y pivot for rotations
The horizontal scaling
The vertical scaling
pol.SetMatrix
Set the individual 2d transformation
pol.Update
Updates internal properties
Indicates the objects visibility state
The obects width