UNPKG

orion-engine

Version:

A simple and lightweight web based game development library

30 lines (29 loc) 970 B
import { ScreenInterface } from './types'; export declare class Screen implements ScreenInterface { private _screenWidth; private _screenHeight; private _resizeCallbacks; constructor(); /** * Returns the screen width. * @returns The screen width. */ getScreenWidth(): number; /** * Returns the screen height. * @returns The screen height. */ getScreenHeight(): number; /** * Sets the screen resolution. * @param width The width of the screen. * @param height The height of the screen. * @param fullscreen Whether to enter fullscreen mode or not. */ setResolution(width: number, height: number, fullscreen: boolean): void; /** * Registers a callback function to be called when the screen is resized. * @param callback The callback function to be called when the screen is resized. */ onResize(callback: () => void): void; }