The height of the game canvas in pixels, (physical height component of the resolution of the canvas element)
The width of the game canvas in pixels (physical width component of the resolution of the canvas element)
Returns the content area in screen space where it is safe to place content
Returns the height of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
Returns the width of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
Returns half height of the game canvas in pixels (half physical height component)
Returns half width of the game canvas in pixels (half physical width component)
Returns half the height of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
Returns half the width of the engine's visible drawing surface in pixels including zoom and device pixel ratio.
Returns true if excalibur is fullscreen using the browser fullscreen api
Returns a BoundingBox of the top left corner of the screen and the bottom right corner of the screen.
World bounds are in world coordinates, useful for culling objects offscreen
Requests to go fullscreen using the browser fullscreen api, requires user interaction to be successful. For example, wire this to a user click handler.
Optionally specify a target element id to go fullscreen, by default the game canvas is used
Optional
elementId: stringTakes a coordinate in normal html page space, for example from a pointer move event, and translates it to Excalibur screen space.
Excalibur screen space starts at the top left (0, 0) corner of the viewport, and extends to the bottom right corner (resolutionX, resolutionY)
Takes a coordinate in Excalibur screen space, and translates it to normal html page space. For example, this is where html elements might live if you want to position them relative to Excalibur.
Excalibur screen space starts at the top left (0, 0) corner of the viewport, and extends to the bottom right corner (resolutionX, resolutionY)
Takes a coordinate in Excalibur screen space, and translates it to Excalibur world space.
World space is where entities in Excalibur live by default CoordPlane.World and extends infinitely out relative from the Camera.
Screen coordinate to convert
Takes a coordinate in Excalibur world space, and translates it to Excalibur screen space.
Screen space is where screen elements and entities with CoordPlane.Screen live.
World coordinate to convert
The Screen handles all aspects of interacting with the screen for Excalibur.