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[][]

collisionable

collisionable: boolean

tileCount

tileCount: Coordinate

tileSize

tileSize: Dimension

view

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

ID

  • get ID(): string

color

  • get color(): Color
  • set color(color: Color): void

coordinate

height

  • get height(): number
  • set height(height: number): void

model

parent

regionDimension

regions

texture

  • get texture(): Asset
  • set texture(asset: Asset): void

type

  • get type(): string
  • set type(type: string): void

visible

  • get visible(): boolean
  • set visible(state: boolean): void

width

  • get width(): number
  • set width(width: number): void

x

  • get x(): number
  • set x(x: number): void

x2

  • get x2(): number

y

  • get y(): number
  • set y(y: number): void

y2

  • get y2(): number

z

  • get z(): number
  • set z(z: number): void

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

    Iterator

getCoordinate

getLocation

getMaxListeners

  • getMaxListeners(): number

getOuterCoordinate

getSize

getTile

getTiles

indexOf

  • indexOf(child: Entity): number

isChild

  • isChild(child: Entity): boolean

isModified

  • isModified(): boolean

iterator

  • public iterator DEPRECATED - use getChildren()

    Creates a child node iterator for this entity.
    

    Returns Iterator

    { 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

setLocation

setMaxListeners

  • setMaxListeners(n: number): this

setSize

Static listenerCount

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

Generated using TypeDoc