Skip to main content

IsometricMap

The IsometricMap is a special tile map that provides isometric rendering support to Excalibur

The tileWidth and tileHeight should be the height and width in pixels of the parallelogram of the base of the tile art asset. The tileWidth and tileHeight is not necessarily the same as your graphic pixel width and height.

Please refer to the docs https://excaliburjs.com for more details calculating what your tile width and height should be given your art assets.

Hierarchy

Implements

  • HasNestedPointerEvents

Index

Constructors

constructor

Properties

publicchildrenAdded$

childrenAdded$: Observable<Entity<any>> = ...

publicchildrenRemoved$

childrenRemoved$: Observable<Entity<any>> = ...

publiccollider

Isometric map ColliderComponent

publicreadonlycolumns

columns: number

Number of tiles wide

publiccomponentAdded$

componentAdded$: Observable<Component> = ...

publiccomponentRemoved$

componentRemoved$: Observable<Component> = ...

publiccomponentValues

componentValues: Component[] = []

publicreadonlycomponents

components: Map<Function, Component> = ...

Current components on the entity

Do not modify

Use addComponent/removeComponent otherwise the ECS will not be notified of changes.

publicreadonlyelevation

elevation: number = 0

publicevents

events: EventEmitter<EntityEvents> = ...

Listen to or emit events for an entity

publicgraphicsOffset

graphicsOffset: Vector = ...

publicid

id: number = ...

The unique identifier for the entity

publicisActive

isActive: boolean = true

Whether this entity is active, if set to false it will be reclaimed

publicisVisible

isVisible: boolean = true

Whether tiles should be visible

publicname

name: string = ...

publicopacity

opacity: number = 1.0

Opacity of tiles

publicpointer

publicrenderFromTopOfGraphic

renderFromTopOfGraphic: boolean = false

Render the tile graphic from the top instead of the bottom

default is false meaning rendering from the bottom

publicreadonlyrows

rows: number

Number of tiles high

publicscene

scene: Scene<unknown> = null

The current scene that the entity is in, if any

publictagAdded$

tagAdded$: Observable<string> = ...

publictagRemoved$

tagRemoved$: Observable<string> = ...

publicreadonlytileHeight

tileHeight: number

Height of individual tile in pixels

publicreadonlytileWidth

tileWidth: number

Width of individual tile in pixels

publicreadonlytiles

tiles: IsometricTile[]

List containing all of the tiles in IsometricMap

publictransform

Isometric map TransformComponent

Accessors

publicactive

  • get active(): boolean
  • set active(val: boolean): void
  • Whether this entity is active, if set to false it will be reclaimed

    @deprecated

    use isActive


    Returns boolean

  • Whether this entity is active, if set to false it will be reclaimed

    @deprecated

    use isActive


    Parameters

    • val: boolean

    Returns void

publicchildren

  • get children(): readonly Entity<any>[]
  • Get the direct children of this entity


    Returns readonly Entity<any>[]

publicisAdded

  • get isAdded(): boolean
  • Returns boolean

publicisInitialized

  • get isInitialized(): boolean
  • Gets whether the actor is Initialized


    Returns boolean

publicparent

  • Returns Entity<any>

publictags

  • get tags(): Set<string>
  • Specifically get the tags on the entity from TagsComponent


    Returns Set<string>

publictypes

  • The types of the components on the Entity


    Returns ComponentCtor[]

publicvisible

  • get visible(): boolean
  • set visible(val: boolean): void
  • Whether tiles should be visible

    @deprecated

    use isVisible


    Returns boolean

  • Whether tiles should be visible

    @deprecated

    use isVisible


    Parameters

    • val: boolean

    Returns void

Methods

publicaddChild

  • Adds an entity to be a child of this entity


    Parameters

    Returns Entity<any>

publicaddComponent

  • addComponent<TComponent>(component: TComponent, force?: boolean): Entity<any>
  • Adds a component to the entity


    Type parameters

    Parameters

    • component: TComponent

      Component or Entity to add copy of components from

    • force: boolean = false

      Optionally overwrite any existing components of the same type

    Returns Entity<any>

publicaddTag

  • addTag(tag: string): Entity<any>
  • Adds a tag to an entity


    Parameters

    • tag: string

    Returns Entity<any>

publicaddTemplate

  • addTemplate(templateEntity: Entity<any>, force?: boolean): Entity<any>
  • Adds a copy of all the components from another template entity as a "prefab"


    Parameters

    • templateEntity: Entity<any>

      Entity to use as a template

    • force: boolean = false

      Force component replacement if it already exists on the target entity

    Returns Entity<any>

publicclearComponents

  • clearComponents(): void
  • Returns void

publicclone

  • Creates a deep copy of the entity and a copy of all its components


    Returns Entity<any>

publicdebug

publicemit

  • emit<TEventName>(eventName: TEventName, event: EntityEvents[TEventName]): void
  • emit(eventName: string, event?: any): void

publicflagCollidersDirty

  • flagCollidersDirty(): void
  • Returns void

get

publicgetAncestors

  • Returns a list of parent entities starting with the topmost parent. Includes the current entity.


    Returns Entity<any>[]

publicgetComponents

  • Returns all component instances on entity


    Returns Component[]

publicgetDescendants

  • getDescendants(): Entity<any>[]
  • Returns a list of all the entities that descend from this entity. Includes the current entity.


    Returns Entity<any>[]

publicgetTile

publicgetTileByPoint

publichas

  • Check if a component type exists


    Type parameters

    Parameters

    Returns boolean

hasAll

  • hasAll<TComponent>(requiredTypes: ComponentCtor<TComponent>[]): boolean
  • Verifies that an entity has all the required types


    Type parameters

    Parameters

    Returns boolean

hasAllTags

  • hasAllTags(requiredTags: string[]): boolean
  • Verifies that an entity has all the required tags


    Parameters

    • requiredTags: string[]

    Returns boolean

publichasTag

  • hasTag(tag: string): boolean
  • Check if a tag exists on the entity


    Parameters

    • tag: string

      name to check for

    Returns boolean

publicisKilled

  • isKilled(): boolean
  • Returns boolean

publickill

  • kill(): void
  • Kill the entity, means it will no longer be updated. Kills are deferred to the end of the update. If parented it will be removed from the parent when killed.


    Returns void

publicoff

  • off<TEventName>(eventName: TEventName, handler: Handler<EntityEvents[TEventName]>): void
  • off(eventName: string, handler: Handler<unknown>): void
  • off(eventName: string): void

publicon

publiconAdd

  • onAdd(engine: Engine<any>): void
  • onAdd is called when Actor is added to scene. This method is meant to be overridden.

    Synonymous with the event handler .on('add', (evt) => {...})


    Parameters

    Returns void

publiconInitialize

  • onInitialize(engine: Engine<any>): void
  • onInitialize is called before the first update of the entity. This method is meant to be overridden.

    Synonymous with the event handler .on('initialize', (evt) => {...})


    Parameters

    Returns void

publiconPostUpdate

  • onPostUpdate(engine: Engine<any>, elapsed: number): void
  • Safe to override onPostUpdate lifecycle event handler. Synonymous with .on('postupdate', (evt) =>{...})

    onPostUpdate is called directly after an entity is updated.


    Parameters

    • engine: Engine<any>
    • elapsed: number

    Returns void

publiconPreUpdate

  • onPreUpdate(engine: Engine<any>, elapsed: number): void
  • Safe to override onPreUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})

    onPreUpdate is called directly before an entity is updated.


    Parameters

    • engine: Engine<any>
    • elapsed: number

    Returns void

publiconRemove

  • onRemove(engine: Engine<any>): void
  • onRemove is called when Actor is added to scene. This method is meant to be overridden.

    Synonymous with the event handler .on('remove', (evt) => {...})


    Parameters

    Returns void

publiconce

publicremoveAllChildren

  • removeAllChildren(): Entity<any>
  • Removes all children from this entity


    Returns Entity<any>

publicremoveChild

  • Remove an entity from children if it exists


    Parameters

    Returns Entity<any>

publicremoveComponent

  • removeComponent<TComponent>(typeOrInstance: TComponent | ComponentCtor<TComponent>, force?: boolean): Entity<Exclude<any, TComponent>>
  • Removes a component from the entity, by default removals are deferred to the end of entity update to avoid consistency issues

    Components can be force removed with the force flag, the removal is not deferred and happens immediately


    Type parameters

    Parameters

    • typeOrInstance: TComponent | ComponentCtor<TComponent>
    • force: boolean = false

    Returns Entity<Exclude<any, TComponent>>

publicremoveTag

  • removeTag(tag: string): Entity<any>
  • Removes a tag on the entity

    Removals are deferred until the end of update


    Parameters

    • tag: string

    Returns Entity<any>

publictileToWorld

  • Given a tile coordinate, return the top left corner in world space


    Parameters

    Returns Vector

publicunparent

  • unparent(): void
  • Unparents this entity, if there is a parent. Otherwise it does nothing.


    Returns void

publicupdate

  • update(): void
  • Returns void

publicupdateColliders

  • updateColliders(): void
  • Returns void

publicworldToTile

  • Convert world space coordinates to the tile x, y coordinate


    Parameters

    Returns Vector