API Docs for: 0.1.1
Show:

flatworld.ObjectManager Class

this module is responsible for doing hitTesting, like returning the units on certain clicked coordinates or when objects or areas collide with each other.

Constructor

flatworld.ObjectManager

()

Item Index

Methods

Methods

retrieve

(
  • allCoords
  • type
  • options
)
Array

Retrieve objects under certain coordinates or area, if size is given. Uses subcontainers when used, no other options yet.

Parameters:

  • allCoords Object

    The coordinates which we want to hitTest

    • globalCoords X:Integer, y:Integer

      Global coordinates on static layer / canvas

      • x X:Integer, y:Integer
      • y X:Integer, y:Integer
    • localCoords Object

      Local coordiantes on movable layer

      • x X:Integer, y:Integer
      • y X:Integer, y:Integer
  • type String

    type of the object / layer that we want to retrieve

  • options Object

    optional options

    • subcontainers Array

      The subcontainers we match against

    • size Object

      Size of the rectangle area to match against, if we want to match rectangle instead of one point

      • width Integer
      • height Integer

Returns:

Array:

matched objects