API Docs for: 0.1.1
Show:

flatworld.maplayers.MapLayerParent Class

Layer designed to hold subcontainers. But can handle objects too. Different devices graphic cards can only have specific size of bitmap drawn, and PIXI cache always draws a bitmap. Thus the default is: 4096, based on this site: http://webglstats.com/ and MAX_TEXTURE_SIZE

Constructor

flatworld.maplayers.MapLayerParent

(
  • options
)

Parameters:

  • options Object
    • name String

      name layer property name, used for identifiying the layer, usefull in debugging, but used also otherwise too

    • coord Object

      starting coords of layer. Relative to parent map layer.

      • x Integer
        X coordinate
      • y Integer
        Y coordinate
    • subcontainers Object

      Subontainer size. If given activated subcontainers, otherwise not.

      • width Integer
        width (in pixels)
      • height Integer
        height (in pixels)
    • specialLayer Boolean

      Is this special layer or not.

Methods

addChild

(
  • displayObject
)

We override the PIXIs own addchild functionality. Since we need to support subcontainers in addChild. We check subcontainers and then we call the original (PIXIs) addChild

Parameters:

  • displayObject PIXI.DisplayObject

    PIXI.DisplayObject

getSubcontainerConfigs

()

Returns the configurations set for subcontainers.

getSubcontainers

()

getSubcontainersByCoordinates

(
  • coordinates
  • options.filter
)

Returns subcontainers based on the given coordinates. Can be applied through a MapDataManipulator filter also.

Parameters:

  • coordinates Object
    • x Integer

      X coordinate

    • y Integer

      Y coordinate

  • options.filter MapDataManipulator

    Filter for selecting only certain subcontainers