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

The title.

title: string;

width

The width.

width: number;

height

The height.

height: number;

currentFrame

The zero-based frame counter.

currentFrame: number;

audioEngine

The audio engine.

audioEngine: AudioEngine;

main

The main.

main: Window;

gravity

The gravitational acceleration applied by the simulation.

gravity: number;

usesDeferred

Whether the window uses deferred rendering.

usesDeferred: boolean;

Methods

setClearColor

Sets clear color.

setClearColor(color: Color): void;

close

Close.

close(): void;

setFullscreen

Sets fullscreen.

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

setWindowed

Sets windowed.

setWindowed(config: WindowConfiguration): void;

enumerateMonitors

Enumerate monitors.

enumerateMonitors(): Monitor[];

getControllers

Returns controllers.

getControllers(): ControllerID[];

getController

Returns controller.

getController(id: ControllerID): Controller | null;

getJoystick

Returns joystick.

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

Sets camera.

setCamera(camera: Camera): void;

setScene

Sets scene.

setScene(scene: Scene): void;

getTime

Returns time.

getTime(): number;

isKeyActive

Reports whether key active.

isKeyActive(key: Key): boolean;

isMouseButtonActive

Reports whether mouse button active.

isMouseButtonActive(button: MouseButton): boolean;

isMouseButtonPressed

Reports whether mouse button pressed.

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

Reports whether controller button pressed.

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

getControllerAxisValue

Returns controller axis value.

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

getControllerAxisPairValue

Returns controller axis pair value.

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

releaseMouse

Releases mouse capture.

releaseMouse(): void;

captureMouse

Captures the mouse for relative input.

captureMouse(): void;

getCursorPosition

Returns cursor position.

getCursorPosition(): Position2d;

getCurrentScene

Returns current scene.

getCurrentScene(): Scene;

getCamera

Returns the active camera.

getCamera(): Camera;

addRenderTarget

Adds render target.

addRenderTarget(): RenderTarget;

getSize

Returns the current dimensions.

getSize(): Size2d;

activateDebug

Activate debug.

activateDebug(): void;

desactivateDebug

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

desactivateDebug(): void;

getDeltaTime

Returns delta time.

getDeltaTime(): number;

getFramesPerSecond

Returns frames per second.

getFramesPerSecond(): number;

useAtlasTracer

Configures the use of atlas tracer.

useAtlasTracer(enabled: boolean): void;

setLogOutput

Sets log output.

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

getRenderScale

Returns render scale.

getRenderScale(): number;

useMetalUpscaling

Configures the use of metal upscaling.

useMetalUpscaling(ratio: number): void;

isMetalUpscalingEnabled

Reports whether metal upscaling enabled.

isMetalUpscalingEnabled(): boolean;

getMetalUpscalingRatio

Returns metal upscaling ratio.

getMetalUpscalingRatio(): number;

getSSAORenderScale

Returns screen-space ambient occlusion render scale.

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

Reports whether action triggered.

isActionTriggered(name: string): boolean;

isActionCurrentlyActive

Reports whether action currently active.

isActionCurrentlyActive(name: string): boolean;

getActionAxisValue

Returns action axis value.

getActionAxisValue(name: string): AxisPacket;

On this page