Excalibur.js logoDocsSamplesCommunityGalleryContributeBlogDonate
Open Table of Contents Close Table of Contents
Documentation
Introduction
WelcomeExcalibur's Philosophy
Getting Started
Installation GuideGetting StartedBuild & Bundlers
Fundamentals
ActorsEngine FundamentalsCamerasScenesClock
Screen & Viewport
DisplayModesScreen & Viewport
Graphics
ColorGraphicsLinesSpritesSpritesheetsText & FontsAnimationCanvasGraphics ComponentGraphics GroupGraphics ContextParallaxPostProcessorsCustom Renderer Plugins
Entity Component System
ECSEntitiesComponentsSystemsQueries
Resources
ImageSourceLoaderSound
Actions
ActionsBlinkCallMethodParallel ActionsDelayEaseToMoveTo/MoveByFadeRotateTo/RotateByRepeatDieFollowMeetScaleTo/ScaleBy
TileMaps
Isometric TileMapsTileMap
Math
MatrixRandomRayVector
Physics
PhysicsFixed UpdateBodiesCollidersCollision EventsCollision GroupsCollision Types
Input
InputKeyboardPointersGamepad
Migration Guides
Migration
Other
Debugging TipsEventsPatternsTimersTriggersUIParticlesPerformanceHosting Excalibur GamesUtilities
Plugins
Aseprite pluginTiled PluginDev Tool
Examples
API Reference
Edge (latest)v0.27.0v0.26.0v0.25.3v0.25.2v0.25.1

Triggers

Triggers can be used to fire logic when an Actor intersects with a Collider, this is useful for in game switches, doors, or other in game sensors.

Trigger

const trigger = new ex.Trigger({
  width: 100,
  height: 100,
  pos: ex.vec(100, 100),
  action: () => {
    console.log('triggered')
  },
})
Get Involved
GitHub RepoOpen an IssueAsk a QuestionDonate
Excalibur.js logo
Free & Open Source (BSD 2-Clause)