Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GridMap

Hierarchy

Index

Constructors

constructor

Properties

Protected _children

_children: Entity[]

Protected _model

_model: EntityModel

Protected _parent

_parent: Entity

Private _tiles

_tiles: Entity[][]

Protected _view

_view: EntityView

tileCount

tileCount: Coordinate

tileSize

tileSize: Dimension

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addChild

  • addChild(child: Entity): void

addListener

  • addListener(event: string | symbol, listener: function): this

childCount

  • childCount(): number

emit

  • emit(event: string | symbol, ...args: any[]): boolean

eventNames

  • eventNames(): Array<string | symbol>

findChildren

findTopChildAt

  • public findTopChildAt

    Tries to find the deepest child at the top most layer at this coordinates. TODO: Update this to support Layers once we have layers...

    Parameters

    Returns Entity | boolean

    Entity

getAbsoluteX

  • getAbsoluteX(): number

getAbsoluteX2

  • getAbsoluteX2(): number

getAbsoluteY

  • getAbsoluteY(): number

getAbsoluteY2

  • getAbsoluteY2(): number

getChildAt

  • getChildAt(index: number): Entity

getChildren

  • public getChildren

    Returns an Iterator of Children.  Can pass
    in a set of coordinates to get children in a specific
    region of coordinates relative to the entity (0,0 is top left of this entity).
    If only the starTCoordinate is specified, looks up children who intersect with that point.
    If both arguements are passed in, looks for children who intersect with the rect the coords create.
    If neither are provided, just returns an iterator of all children.
    

    Not recursive, only checks it's own children

    Parameters

    Returns Iterator<Entity>

    Iterator

getColor

getCoordinate

getHeight

  • getHeight(): number

getID

  • getID(): string

getLocation

getMaxListeners

  • getMaxListeners(): number

getModel

getOuterCoordinate

getParent

getRegionDimension

getRegions

getSize

getTexture

getTile

getTiles

getType

  • getType(): string

getVisible

  • getVisible(): boolean

getWidth

  • getWidth(): number

getX

  • getX(): number

getX2

  • getX2(): number

getY

  • getY(): number

getY2

  • getY2(): number

getZ

  • getZ(): number

indexOf

  • indexOf(child: Entity): number

isChild

  • isChild(child: Entity): boolean

isCollisionable

  • isCollisionable(): boolean

isModified

  • isModified(): boolean

iterator

  • public iterator DEPRECATED - use getChildren()

    Creates a child node iterator for this entity.
    

    Returns Iterator<Entity>

    { hasNext : function() next : function() hasPrevious : function() previous : function() }

listenerCount

  • listenerCount(type: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]

on

  • on(event: string | symbol, listener: function): this

once

  • once(event: string | symbol, listener: function): this

prependListener

  • prependListener(event: string | symbol, listener: function): this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this

removeAllChildren

  • removeAllChildren(): void

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeChild

  • removeChild(child: Entity): void

removeListener

  • removeListener(event: string | symbol, listener: function): this

setCollisionable

  • setCollisionable(collisionable: boolean): void

setColor

  • setColor(color: Color): void

setCoordinate

setHeight

  • setHeight(height: number): void

setLocation

setMaxListeners

  • setMaxListeners(n: number): this

setModel

setParent

  • setParent(parent: Entity): void

setSize

setTexture

  • setTexture(asset: Asset): void

setType

  • setType(type: string): void

setVisible

  • setVisible(state: boolean): void

setWidth

  • setWidth(width: number): void

setX

  • setX(x: number): void

setY

  • setY(y: number): void

setZ

  • setZ(z: number): void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number

Generated using TypeDoc