GamePreference
Methods
- .define(tag, registry)
Defines a single preference. Place inside <game-preferences>.
Attributes
- type
-
"toggle" | "range"-- The input type.toggle-- A switch (on/off). Value isboolean.range-- A slider. Value isnumber.
- key
-
string-- The preference key, used for persistence and.get(key). - label
-
string-- Display label shown next to the input. - default
-
string-- Default value. For toggles:"true"or"false". For ranges: a number string. - min
-
number-- Minimum value for range inputs. Default:0. - max
-
number-- Maximum value for range inputs. Default:100.
Touch Isolation
Range slider inputs have touchstart, touchmove, and touchend event propagation stopped, so dragging a volume slider on mobile does not trigger game input underneath.
CSS Custom Properties
The panel uses the same --game-btn-bg, --game-btn-text, --game-text, and --game-accent custom properties as the rest of the framework.