IsometricMap
Hierarchy
- Entity
- IsometricMap
Index
Constructors
Properties
Accessors
Methods
- addChild
- addComponent
- addTag
- addTemplate
- clearComponents
- clone
- debug
- emit
- flagCollidersDirty
- get
- getAncestors
- getComponents
- getDescendants
- getTile
- getTileByPoint
- has
- hasAll
- hasAllTags
- hasTag
- isKilled
- kill
- off
- on
- onInitialize
- onPostUpdate
- onPreUpdate
- once
- removeAllChildren
- removeChild
- removeComponent
- removeTag
- tileToWorld
- unparent
- update
- updateColliders
- worldToTile
Constructors
constructor
Parameters
options: IsometricMapOptions
Returns IsometricMap
Properties
publicactive
Whether this entity is active, if set to false it will be reclaimed
publicchildrenAdded$
publicchildrenRemoved$
publiccollider
Isometric map [[ColliderComponent]]
publicreadonlycolumns
Number of tiles wide
publiccomponentAdded$
publiccomponentRemoved$
publicreadonlycomponents
Current components on the entity
Do not modify
Use addComponent/removeComponent otherwise the ECS will not be notified of changes.
publicreadonlyelevation
publicevents
Listen to or emit events for an entity
publicgraphicsOffset
publicid
The unique identifier for the entity
publicname
publicopacity
Opacity of tiles
publicrenderFromTopOfGraphic
Render the tile graphic from the top instead of the bottom
default is false
meaning rendering from the bottom
publicreadonlyrows
Number of tiles high
publicscene
The current scene that the entity is in, if any
publictagAdded$
publictagRemoved$
publicreadonlytileHeight
Height of individual tile in pixels
publicreadonlytileWidth
Width of individual tile in pixels
publicreadonlytiles
List containing all of the tiles in IsometricMap
publictransform
Isometric map [[TransformComponent]]
publicvisible
Whether tiles should be visible
Accessors
publicchildren
Get the direct children of this entity
Returns readonly Entity<any>[]
publicisInitialized
Gets whether the actor is Initialized
Returns boolean
publicparent
Returns Entity<any>
publictags
Specifically get the tags on the entity from [[TagsComponent]]
Returns Set<string>
publictypes
The types of the components on the Entity
Returns ComponentCtor[]
Methods
publicaddChild
publicaddComponent
publicaddTag
Adds a tag to an entity
Parameters
tag: string
Returns void
publicaddTemplate
publicclearComponents
Returns void
publicclone
Creates a deep copy of the entity and a copy of all its components
Returns Entity<any>
publicdebug
Debug draw for IsometricMap, called internally by excalibur when debug mode is toggled on
Parameters
gfx: ExcaliburGraphicsContext
debugFlags: DebugConfig
Returns void
publicemit
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
event: EntityEvents[TEventName]
Returns void
publicflagCollidersDirty
Returns void
get
Type parameters
- TComponent: Component
Parameters
type: ComponentCtor<TComponent>
Returns MaybeKnownComponent<TComponent, any>
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
Returns a list of all the entities that descend from this entity. Includes the current entity.
Returns Entity<any>[]
publicgetTile
Returns the [[IsometricTile]] by its x and y coordinates
Parameters
x: number
y: number
Returns IsometricTile
publicgetTileByPoint
Returns the [[IsometricTile]] by testing a point in world coordinates, returns
null
if no Tile was found.Parameters
point: Vector
Returns IsometricTile
publichas
Check if a component type exists
Type parameters
- TComponent: Component
Parameters
type: ComponentCtor<TComponent>
Returns boolean
hasAll
Verifies that an entity has all the required types
Type parameters
- TComponent: Component
Parameters
requiredTypes: ComponentCtor<TComponent>[]
Returns boolean
hasAllTags
Verifies that an entity has all the required tags
Parameters
requiredTags: string[]
Returns boolean
publichasTag
Check if a tag exists on the entity
Parameters
tag: string
name to check for
Returns boolean
publicisKilled
Returns boolean
publickill
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
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
handler: Handler<EntityEvents[TEventName]>
Returns void
publicon
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
handler: Handler<EntityEvents[TEventName]>
Returns Subscription
publiconInitialize
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
engine: Engine<any>
Returns void
publiconPostUpdate
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>
delta: number
Returns void
publiconPreUpdate
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>
delta: number
Returns void
publiconce
Type parameters
- TEventName: EventKey<EntityEvents>
Parameters
eventName: TEventName
handler: Handler<EntityEvents[TEventName]>
Returns Subscription
publicremoveAllChildren
Removes all children from this entity
Returns Entity<any>
publicremoveChild
publicremoveComponent
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 immediatelyType parameters
- TComponent: Component
Parameters
typeOrInstance: TComponent | ComponentCtor<TComponent>
force: boolean = false
Returns Entity<Exclude<any, TComponent>>
publicremoveTag
Removes a tag on the entity
Removals are deferred until the end of update
Parameters
tag: string
Returns void
publictileToWorld
publicunparent
Unparents this entity, if there is a parent. Otherwise it does nothing.
Returns void
publicupdate
Returns void
publicupdateColliders
Returns void
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.