RenderQualityManager

Owns the game's current render quality level. Reach it through game.renderQuality; most games only need Game.setQualityLevel() or Game.enableAdaptiveQuality().


Constructor

new RenderQualityManager( renderer: BGE.Renderer, initialLevel: integer, ): RenderQualityManager

Parameters

  • renderer (BGE.Renderer) — the renderer to apply settings to (the game canvas)
  • initialLevel (integer) — a BGE.RenderQualityLevel value

Instance Methods

getLevel(): BGE.RenderQualityLevel

Returns

setLevel(level: integer): boolean

Switches to a level (clamped). Does not change whether adaptive tuning is on - use Game.setQualityLevel() to pin a level.

Parameters

  • level (integer) — a BGE.RenderQualityLevel value

Returns

  • boolean — true if the level changed

overridePreset(level: integer, fields: roAssociativeArray): void

Replaces individual settings for one level, keeping the engine defaults for everything else. Repeated calls accumulate.

Parameters

  • level (integer) — a BGE.RenderQualityLevel value
  • fields (roAssociativeArray) — e.g. {planeSliceCount: 80, drawDistanceScale: 1.2}

Returns

  • void

getSettings(level: integer): BGE.RenderQualitySettings

The settings a level uses: the engine preset plus any overrides.

Parameters

  • level (integer) — a BGE.RenderQualityLevel value

Returns

enableAdaptive(options?: BGE.AdaptiveQualityOptions): boolean

Starts adjusting the level automatically to hold a frame rate. If the current level is outside the options' minLevel/maxLevel, it moves to the nearest one.

Parameters

Returns

  • boolean — true if the level changed to fit minLevel/maxLevel

disableAdaptive(): void

Returns

  • void

isAdaptive(): boolean

Returns

  • boolean — whether the level is being adjusted automatically

update(dt: float): boolean

Game calls this once per frame with the full frame time.

Parameters

  • dt (float)

Returns

  • boolean — true if the level changed this frame

notifySceneChanged(): void

Game calls this after a scene change.

Returns

  • void