Geometry API Reference


Geometry

A Geometry is a 2D geometric shape, used to provide visual shape that can be drawn by actors. Generally a Geometry should be added to either a scene or the global app’s resources so that it can be managed by them.

Public properties

  • name – The name of the geometry, this name is used when searching for resources in a Scene’s resources or the the app’s global resources
  • vertices – An array of vertices that represents  geometry in the form of [x1, y1, x2, y2, ...]

Methods

Geometry(name, vertices) – Creates an instance of a geometry object

  • name – Name of the geometry
  • vertices – An array of vertices in the form of [x1, y1, x2, y2, etc] (optional)

Examples

Example showing how to create a geometry

 

197 total views, 1 views today