Skip to main content

Class: Screen

Constructors​

constructor​

• new Screen(ctx, «destructured»?)

Parameters​

NameType
ctxRenderingContext2D
«destructured»IScreenOptions

Defined in​

src/Screen.ts:116

Properties​

defaultWindow​

â–ª Static Readonly defaultWindow: Window & typeof globalThis = defaultWindow

Defined in​

src/Screen.ts:98


defaultFetch​

â–ª Static Readonly defaultFetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> = defaultFetch

Type declaration​

â–¸ (input, init?): Promise<Response>

Parameters​
NameType
inputRequestInfo | URL
init?RequestInit
Returns​

Promise<Response>

Defined in​

src/Screen.ts:99


FRAMERATE​

â–ª Static FRAMERATE: number = 30

Defined in​

src/Screen.ts:100


MAX_VIRTUAL_PIXELS​

â–ª Static MAX_VIRTUAL_PIXELS: number = 30000

Defined in​

src/Screen.ts:101


window​

• Readonly window: Window

Defined in​

src/Screen.ts:103


fetch​

• Readonly fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

Type declaration​

â–¸ (input, init?): Promise<Response>

Parameters​
NameType
inputRequestInfo | URL
init?RequestInit
Returns​

Promise<Response>

Defined in​

src/Screen.ts:104


viewPort​

• Readonly viewPort: ViewPort

Defined in​

src/Screen.ts:105


mouse​

• Readonly mouse: Mouse

Defined in​

src/Screen.ts:106


animations​

• Readonly animations: AnimateElement[] = []

Defined in​

src/Screen.ts:107


readyPromise​

• Private readyPromise: Promise<void>

Defined in​

src/Screen.ts:108


resolveReady​

• Private resolveReady: () => void

Type declaration​

â–¸ (): void

Returns​

void

Defined in​

src/Screen.ts:109


waits​

• Private waits: () => boolean[] = []

Defined in​

src/Screen.ts:110


frameDuration​

• Private frameDuration: number = 0

Defined in​

src/Screen.ts:111


isReadyLock​

• Private isReadyLock: boolean = false

Defined in​

src/Screen.ts:112


isFirstRender​

• Private isFirstRender: boolean = true

Defined in​

src/Screen.ts:113


intervalId​

• Private intervalId: number = null

Defined in​

src/Screen.ts:114


ctx​

• Readonly ctx: RenderingContext2D

Defined in​

src/Screen.ts:117

Methods​

wait​

â–¸ wait(checker): void

Parameters​

NameType
checker() => boolean

Returns​

void

Defined in​

src/Screen.ts:132


ready​

â–¸ ready(): Promise<void>

Returns​

Promise<void>

Defined in​

src/Screen.ts:136


isReady​

â–¸ isReady(): boolean

Returns​

boolean

Defined in​

src/Screen.ts:145


setDefaults​

â–¸ setDefaults(ctx): void

Parameters​

NameType
ctxRenderingContext2D

Returns​

void

Defined in​

src/Screen.ts:165


setViewBox​

▸ setViewBox(«destructured»): void

Parameters​

NameType
«destructured»IScreenViewBoxConfig

Returns​

void

Defined in​

src/Screen.ts:173


start​

▸ start(element, «destructured»?): void

Parameters​

NameType
elementElement
«destructured»IScreenStartOptions

Returns​

void

Defined in​

src/Screen.ts:286


stop​

â–¸ stop(): void

Returns​

void

Defined in​

src/Screen.ts:363


shouldUpdate​

â–¸ Private shouldUpdate(ignoreAnimation, forceRedraw): boolean

Parameters​

NameType
ignoreAnimationboolean
forceRedraw() => boolean

Returns​

boolean

Defined in​

src/Screen.ts:372


render​

â–¸ Private render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY): void

Parameters​

NameType
elementElement
ignoreDimensionsboolean
ignoreClearboolean
scaleWidthnumber
scaleHeightnumber
offsetXnumber
offsetYnumber

Returns​

void

Defined in​

src/Screen.ts:406