PolygonActor API reference


A PolygonActor is derived from an Actor that displays a polygon shaped game object instead of an image and inherits all properties, functions and so forth from its parent. A PolygonActor should be added to a Scene or another Actor once created.

Public properties

  • fill_style – Style used to fill the arc
  • stroke_style – Stroke used to draw none filled arc
  • stroke_thickness – Thickness of line stroke
  • filled – if true then arc interior will filled otherwise empty
  • points – An array of points that describe the shape of the actor in the form [x1,y1,x2,y2,....]


PolygonActor() – Creates an instance of a PolygonActor object

draw() – Draws a polygon actor and its children, this method can be overriden by derived actors

drawToCache() – Draws this actor to a cached canvas, subsequent calls to draw() will cause this cached canvas to be drawn instead

update(dt) – Updates the actor, this method can be overriden by derived actors

  • dt – The amount of time that has passed since this actor was last updated


Example showing how to create a polygon based actor


962 total views, 1 views today