DynamicResolution class final

Renders fewer pixels while frames run slow, and more again when there is time to spare: a scale between minScale and maxScale on top of the renderer's own, stepped by what the last second of frames took.

Constructors

DynamicResolution({bool enabled = false, double targetFps = 60, double minScale = 0.5, double maxScale = 1.0, double step = 0.1})
Off until enabled; aims for targetFps.

Properties

enabled ↔ bool
Whether it adjusts at all.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
maxScale ↔ double
The highest scale it goes to.
getter/setter pair
minScale ↔ double
The lowest scale it goes to.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scale → double
The scale now (1 when off).
no setter
step ↔ double
How much the scale moves at a time.
getter/setter pair
targetFps ↔ double
The frame rate to hold.
getter/setter pair

Methods

frame(double seconds) → void
Tells it the last frame took seconds. Once a second it lowers the scale if most frames missed the target, or raises it if nearly all had a fifth of their time to spare.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Back to full scale, forgetting what it measured.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited