Quality beta
Class of @v12-engine/client
export declare class QualityThe quality of the game's drawing (client.quality): the knobs as they are (get), a preset or some knobs set (set), which preset that is (preset), the device (device) and the preset it was guessed to want (suggested), and whether the game is too slow for what is set (slow, onSlow). Kept with the settings, which are its knobs
Members
constructor
constructor(client: GameClientApi, parts: QualityParts, look?: QualityLook);Constructs a new instance of the Quality class
antialiased
readonly antialiased: boolean;Whether the engine was made with anti-aliasing: the setting changes it from the next game
applyAntialias
applyAntialias(mode: Antialias): void;Edges smoothed as antialias says (WorldPicture.antialias): the setting antialias applies it
applyShadows
applyShadows(level: QualityKnobs['shadows']): void;The shadows the sun casts: off, or a map of a size in so many parts
device
readonly device: DeviceInfo;The device the quality was guessed for (DeviceInfo): its graphics card and screen
dismiss
dismiss(): void;The offer put away, as the player said no to it: not offered again until the quality changes
first
readonly first: QualityPreset;The preset of a first run: the guess, or high for a player who played before there were presets
frame
frame(dt: number): void;A frame went by in dt seconds: the client calls it each frame. Half a minute under the budget (frames a second, GameView.world.quality.budget) offers the preset below, once; not while the page is out of sight or the menu open
get
get(): QualityKnobs;Every knob as it is set now. A signal: what reads it follows it. A knob the game left out of its settings (GameSettings.hide) is as the preset on says (high while it is custom): it is not the player's to set
knobChanged
knobChanged(): void;A knob set on its own: the preset is custom from then on, unless the knobs are still one
listen
listen(): () => void;Hears the settings: a preset chosen puts its knobs on. Only a change does (onChange), not the settings put to use as the game starts, where the knobs kept are the player's
lower
lower(): QualityPreset | undefined;The preset below what is set. When the knobs are the player's own: the highest preset whose render resolution is under theirs (the resolution costs the most), else below the nearest preset
onSlow
onSlow(listener: (suggested: QualityPreset, slowness?: QualitySlowness) => void): () => void;Told when the game keeps missing its budget, with the preset that may do better and why. Gives back what stops it
preset
preset(): QualityPreset | 'custom';The preset set now, or custom once a knob was set apart from it. A signal
presets
presets: Readonly<Record<QualityPreset, QualityKnobs>>;Each preset, as the game changed them, its render resolution capped by the game's pixels (QualityLook.pixels)
probe
probe(seconds?: number): Promise<QualityPreset | undefined>;The first run's probe: the card measured by a two-second flight of the camera at high, hidden behind the loading screen with the game held, and the preset its median frame suits put on (kept with the settings, so that it is once). Not for a player who kept a quality, a page driven by automation, a game the player cannot pause, one that plays a cinematic at once, or one that has not asked for it (QualityLook.probe: true). Gives the preset put on, else nothing
set
set(to: QualityPreset | Partial<QualityKnobs>): void;Puts a preset on (every knob as it says), or some knobs: kept with the settings, as the player's choice
slow
readonly slow: Accessor<QualityPreset | null>;A lower preset offered, as the game keeps missing its budget; null while it keeps it. A signal
slowness
readonly slowness: Accessor<QualitySlowness | null>;Why the lower preset is offered (slow): the frames a second, the card's time and its heaviest pass. A signal
suggest
suggest(lower: QualityPreset, slowness?: QualitySlowness): void;Offers a lower preset, with why where it is known: the game first, then whoever listens; put on by itself where the game asks for that
suggested
readonly suggested: QualityPreset;The preset the device was guessed to want
take
take(look: QualityLook): void;Takes what the game says of the quality anew (the editor's Look panel, as the game's quality.json is written): the presets as the game now changes them, capped by its pixels, and the preset that is on put on again with them. Knobs the player set by hand are left as they are
test
readonly test: Accessor<GraphicsTest | 'running' | null>;The graphics test of the settings (testGraphics): 'running' while it flies, then its result. A signal
testGraphics
testGraphics(seconds?: number): Promise<GraphicsTest | null>;The graphics test of the settings: the pause menu put away, the camera flown over the map for seconds with the game held, at the quality as it is set, and the menu back on its settings with the verdict (test). Null where the page was hidden or the menu opened meanwhile
usePreset
usePreset(preset: QualityPreset | 'custom'): void;Puts every knob of a preset on: the setting quality does, as it changes