Link Search Menu Expand Document

Graphics.d overview


Table of contents


utils

Graphics (class)

The static class that carries out graphics processing.

Signature

export declare class Graphics {
  constructor()
}

initialize (static method)

Initializes the graphics system.

Signature

static initialize(): boolean

setTickHandler (static method)

Register a handler for tick events.

Signature

static setTickHandler(handler: (deltaTime: number) => void): void

startGameLoop (static method)

Starts the game loop.

Signature

static startGameLoop(): void

stopGameLoop (static method)

Stops the game loop.

Signature

static stopGameLoop(): void

setStage (static method)

Sets the stage to be rendered.

Signature

static setStage(stage: Stage | null): void

startLoading (static method)

Shows the loading spinner.

Signature

static startLoading(): void

endLoading (static method)

Erases the loading spinner.

Signature

static endLoading(): boolean

printError (static method)

Displays the error text to the screen.

Signature

static printError(name: string, message: string, error?: Error | ErrorEvent): void

showRetryButton (static method)

Displays a button to try to reload resources.

Signature

static showRetryButton(retry: () => void): void

eraseError (static method)

Erases the loading error text.

Signature

static eraseError(): void

pageToCanvasX (static method)

Converts an x coordinate on the page to the corresponding x coordinate on the canvas area.

Signature

static pageToCanvasX(x: number): number

pageToCanvasY (static method)

Converts a y coordinate on the page to the corresponding y coordinate on the canvas area.

Signature

static pageToCanvasY(y: number): number

isInsideCanvas (static method)

Checks whether the specified point is inside the game canvas area.

Signature

static isInsideCanvas(x: number, y: number): boolean

showScreen (static method)

Shows the game screen.

Signature

static showScreen(): void

hideScreen (static method)

Hides the game screen.

Signature

static hideScreen(): void

resize (static method)

Changes the size of the game screen.

Signature

static resize(width: number, height: number): void

_createAllElements (static method)

Signature

static _createAllElements(): void

_updateAllElements (static method)

Signature

static _updateAllElements(): void

_onTick (static method)

Signature

static _onTick(deltaTime: number): void

_canRender (static method)

Signature

static _canRender(): boolean

_updateRealScale (static method)

Signature

static _updateRealScale(): void

_stretchWidth (static method)

Signature

static _stretchWidth(): number

_stretchHeight (static method)

Signature

static _stretchHeight(): number

_makeErrorHtml (static method)

Signature

static _makeErrorHtml(name?: string, message?: string, _error?: Error | ErrorEvent): string

_defaultStretchMode (static method)

Signature

static _defaultStretchMode(): boolean

_createErrorPrinter (static method)

Signature

static _createErrorPrinter(): void

_updateErrorPrinter (static method)

Signature

static _updateErrorPrinter(): void

_createCanvas (static method)

Signature

static _createCanvas(): void

_updateCanvas (static method)

Signature

static _updateCanvas(): void

_updateVideo (static method)

Signature

static _updateVideo(): void

_createLoadingSpinner (static method)

Signature

static _createLoadingSpinner(): void

_createFPSCounter (static method)

Signature

static _createFPSCounter(): void

_centerElement (static method)

Signature

static _centerElement(element: HTMLCanvasElement): void

_disableContextMenu (static method)

Signature

static _disableContextMenu(): void

_applyCanvasFilter (static method)

Signature

static _applyCanvasFilter(): void

_clearCanvasFilter (static method)

Signature

static _clearCanvasFilter(): void

_setupEventHandlers (static method)

Signature

static _setupEventHandlers(): void

_onWindowResize (static method)

Signature

static _onWindowResize(): void

_onKeyDown (static method)

Signature

static _onKeyDown(event: KeyboardEvent): void

_switchFPSCounter (static method)

Signature

static _switchFPSCounter(): void

_switchStretchMode (static method)

Signature

static _switchStretchMode(): void

_switchFullScreen (static method)

Signature

static _switchFullScreen(): void

_isFullScreen (static method)

Signature

static _isFullScreen(): boolean

_requestFullScreen (static method)

Signature

static _requestFullScreen(): void

_cancelFullScreen (static method)

Signature

static _cancelFullScreen(): void

_createPixiApp (static method)

Signature

static _createPixiApp(): void

_setupPixi (static method)

Signature

static _setupPixi(): void

_createEffekseerContext (static method)

Signature

static _createEffekseerContext(): void