Atlas Engine
API Referenceatlas

Window

Active runtime window: scene objects, input, audio, display configuration, and frame timing.

Module: atlas

Active runtime window: scene objects, input, audio, display configuration, and frame timing.

Declaration

export class Window { ... }

Properties

title

title: string;

width

width: number;

height

height: number;

currentFrame

currentFrame: number;

audioEngine

audioEngine: AudioEngine;

main

main: Window;

gravity

gravity: number;

usesDeferred

usesDeferred: boolean;

Methods

setClearColor

setClearColor(color: Color): void;

close

close(): void;

setFullscreen

setFullscreen(enabled: boolean): void;
setFullscreen(monitor: Monitor): void;

setWindowed

setWindowed(config: WindowConfiguration): void;

enumerateMonitors

enumerateMonitors(): Monitor[];

getControllers

getControllers(): ControllerID[];

getController

getController(id: ControllerID): Controller | null;

getJoystick

getJoystick(id: ControllerID): Joystick | null;

instantiate

Adds an object to the runtime window.

instantiate(object: GameObject): void;

destroy

Removes an object from the runtime window.

destroy(object: GameObject): void;

addUIObject

Adds a UI element to the window.

addUIObject(object: UIObject): void;

setCamera

setCamera(camera: Camera): void;

setScene

setScene(scene: Scene): void;

getTime

getTime(): number;

isKeyActive

isKeyActive(key: Key): boolean;

isMouseButtonActive

isMouseButtonActive(button: MouseButton): boolean;

isMouseButtonPressed

isMouseButtonPressed(button: MouseButton): boolean;

getTextInput

Returns text collected by the runtime's text input system.

getTextInput(): string;

startTextInput

Enables text input collection.

startTextInput(): void;

stopTextInput

Disables text input collection.

stopTextInput(): void;

isTextInputActive

Reports whether text input collection is enabled.

isTextInputActive(): boolean;

isControllerButtonPressed

isControllerButtonPressed(
            controllerID: number,
            buttonIndex: number,
        ): boolean;

getControllerAxisValue

getControllerAxisValue(controllerID: number, axisIndex: number): number;

getControllerAxisPairValue

getControllerAxisPairValue(
            controllerID: number,
            axisIndexX: number,
            axisIndexY: number,
        ): Position2d;

releaseMouse

Releases mouse capture.

releaseMouse(): void;

captureMouse

Captures the mouse for relative input.

captureMouse(): void;

getCursorPosition

getCursorPosition(): Position2d;

getCurrentScene

getCurrentScene(): Scene;

getCamera

Returns the active camera.

getCamera(): Camera;

addRenderTarget

addRenderTarget(): RenderTarget;

getSize

Returns the current dimensions.

getSize(): Size2d;

activateDebug

activateDebug(): void;

desactivateDebug

Disables the debug display. The method name retains the spelling used by this declaration.

desactivateDebug(): void;

getDeltaTime

getDeltaTime(): number;

getFramesPerSecond

getFramesPerSecond(): number;

useAtlasTracer

useAtlasTracer(enabled: boolean): void;

setLogOutput

setLogOutput(
            showLogs: boolean,
            showWarnings: boolean,
            showErrors: boolean,
        ): void;

getRenderScale

getRenderScale(): number;

useMetalUpscaling

useMetalUpscaling(ratio: number): void;

isMetalUpscalingEnabled

isMetalUpscalingEnabled(): boolean;

getMetalUpscalingRatio

getMetalUpscalingRatio(): number;

getSSAORenderScale

getSSAORenderScale(): number;

addInputAction

Registers a named input action for later polling.

addInputAction(action: InputAction): void;

resetInputActions

Clears the registered input actions.

resetInputActions(): void;

getInputAction

Returns the registered action with this name, or null if it is missing.

getInputAction(name: string): InputAction | null;

isActionTriggered

isActionTriggered(name: string): boolean;

isActionCurrentlyActive

isActionCurrentlyActive(name: string): boolean;

getActionAxisValue

getActionAxisValue(name: string): AxisPacket;

On this page