Host · class
BrowserDisplay
Explained in Display and the host.
class BrowserDisplay implements DisplayControlimport { BrowserDisplay } from '@driftengine/core';Constructor
new
constructor(element: HTMLElement)| Parameter | Type | Description |
|---|---|---|
element | HTMLElement |
Properties
| Name | Type | Description |
|---|---|---|
refreshHzreadonly | number | null | Null always, here: no browser API reports this.MoreMeasuring it from frame intervals is possible and is deliberately not done — the answer would be wrong on exactly the machines that care, where the compositor is capping a display that runs faster. A shell asks the operating system and knows. |
Methods
isFullscreen
isFullscreen(): booleanmode
mode(): WindowModesetMode
setMode(mode: WindowMode): Promise<boolean>| Parameter | Type | Description |
|---|---|---|
mode | WindowMode |
setFullscreen
setFullscreen(on: boolean): Promise<void>| Parameter | Type | Description |
|---|---|---|
on | boolean |
size
size(): { readonly width: number; readonly height: number; }canSetSize
canSetSize(): booleanAlways false, and it touches nothing to say so.
More
The same answer setSize gives and for the same reason, which is why they are written next to
each other: a browser cannot resize a window it did not open, so a settings screen greys the
control rather than offering one that quietly does nothing.
setSize
setSize(_width: number, _height: number): Promise<boolean>Always false.
| Parameter | Type | Description |
|---|---|---|
_width | number | |
_height | number |
More
window.resizeTo is refused for anything but a window the script opened itself, so a browser
genuinely cannot do this. Saying so lets a settings screen disable the control; returning
true and doing nothing would leave a resolution list that appears to work.
displays
displays(): readonly DisplayInfo[]The one screen this browser can see.
More
One entry rather than none: the browser does know the screen it is on, and an empty list would make a settings screen report no displays on a machine that plainly has one. What it does not know is the refresh rate or the names and positions of any other display, and it says so by leaving them null and absent respectively.