Class: Screen
Constructors​
constructor​
• new Screen(ctx
, «destructured»?
)
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
«destructured» | IScreenOptions |
Defined in​
Properties​
defaultWindow​
â–ª Static
Readonly
defaultWindow: Window
& typeof globalThis
= defaultWindow
Defined in​
defaultFetch​
â–ª Static
Readonly
defaultFetch: (input
: RequestInfo
| URL
, init?
: RequestInit
) => Promise
<Response
> = defaultFetch
Type declaration​
â–¸ (input
, init?
): Promise
<Response
>
Parameters​
Name | Type |
---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returns​
Promise
<Response
>
Defined in​
FRAMERATE​
â–ª Static
FRAMERATE: number
= 30
Defined in​
MAX_VIRTUAL_PIXELS​
â–ª Static
MAX_VIRTUAL_PIXELS: number
= 30000
Defined in​
window​
• Readonly
window: Window
Defined in​
fetch​
• Readonly
fetch: (input
: RequestInfo
| URL
, init?
: RequestInit
) => Promise
<Response
>
Type declaration​
â–¸ (input
, init?
): Promise
<Response
>
Parameters​
Name | Type |
---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returns​
Promise
<Response
>
Defined in​
viewPort​
• Readonly
viewPort: ViewPort
Defined in​
mouse​
• Readonly
mouse: Mouse
Defined in​
animations​
• Readonly
animations: AnimateElement
[] = []
Defined in​
readyPromise​
• Private
readyPromise: Promise
<void
>
Defined in​
resolveReady​
• Private
resolveReady: () => void
Type declaration​
â–¸ (): void
Returns​
void
Defined in​
waits​
• Private
waits: () => boolean
[] = []
Defined in​
frameDuration​
• Private
frameDuration: number
= 0
Defined in​
isReadyLock​
• Private
isReadyLock: boolean
= false
Defined in​
isFirstRender​
• Private
isFirstRender: boolean
= true
Defined in​
intervalId​
• Private
intervalId: number
= null
Defined in​
ctx​
• Readonly
ctx: RenderingContext2D
Defined in​
Methods​
wait​
â–¸ wait(checker
): void
Parameters​
Name | Type |
---|---|
checker | () => boolean |
Returns​
void
Defined in​
ready​
â–¸ ready(): Promise
<void
>
Returns​
Promise
<void
>
Defined in​
isReady​
â–¸ isReady(): boolean
Returns​
boolean
Defined in​
setDefaults​
â–¸ setDefaults(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Defined in​
setViewBox​
▸ setViewBox(«destructured»
): void
Parameters​
Name | Type |
---|---|
«destructured» | IScreenViewBoxConfig |
Returns​
void
Defined in​
start​
â–¸ start(element
, «destructured»?
): void
Parameters​
Name | Type |
---|---|
element | Element |
«destructured» | IScreenStartOptions |
Returns​
void
Defined in​
stop​
â–¸ stop(): void
Returns​
void
Defined in​
shouldUpdate​
â–¸ Private
shouldUpdate(ignoreAnimation
, forceRedraw
): boolean
Parameters​
Name | Type |
---|---|
ignoreAnimation | boolean |
forceRedraw | () => boolean |
Returns​
boolean
Defined in​
render​
â–¸ Private
render(element
, ignoreDimensions
, ignoreClear
, scaleWidth
, scaleHeight
, offsetX
, offsetY
): void
Parameters​
Name | Type |
---|---|
element | Element |
ignoreDimensions | boolean |
ignoreClear | boolean |
scaleWidth | number |
scaleHeight | number |
offsetX | number |
offsetY | number |
Returns​
void