Settings Menus
Build settings menus for graphics, audio, and controls with persistence.
Introduction
Settings menus let players customize their experience. This guide covers graphics quality, audio levels, control rebinding, and persisting settings to cloud.
Guide 24 of 25
Screenshot
Step-by-Step Guide
Create settings categories
Organize settings into tabs: Graphics, Audio, Controls, Gameplay. Each tab has its own panel.
Add graphics options
Include quality presets (Low/Medium/High/Ultra), shadow quality, render scale, vsync, and field of view.
Add audio options
Master volume, music, SFX, voice volume. Use sliders (0-100%). Apply in real-time so players hear changes.
Add control rebinding
List all actions with current key bindings. Click a binding to remap — listen for the next key press.
Persist settings
Save all settings to cloud storage. Load on game start. Include a Reset to Defaults button.
Apply immediately
Changes should take effect instantly — do not require a restart. Graphics and audio apply at runtime.
FluxScript Example
Here is a complete FluxScript implementation for this guide:
const DEFAULT_SETTINGS = {
graphics: { quality: "medium", shadows: "medium", renderScale: 1.0, fov: 60 },
audio: { master: 80, music: 70, sfx: 90, voice: 85 },
controls: { moveForward: "w", jump: "space", attack: "e" }
}
settings = null
rebindingAction = null
on start {
loadSettings()
applyAllSettings()
}
func loadSettings() {
saved = save.get("gameSettings")
if saved != null settings = mergeDefaults(DEFAULT_SETTINGS, saved)
else settings = copy(DEFAULT_SETTINGS)
}
func saveSettings() {
save.set("gameSettings", settings)
save.flush()
}
func applyGraphicsSettings() {
g = settings.graphics
world.setRenderScale(g.renderScale)
lighting.setShadowQuality(g.shadows)
world.setVSync(true)
scene.find("MainCamera").setFOV(g.fov)
}
func applyAudioSettings() {
a = settings.audio
audio.setMasterVolume(a.master / 100)
audio.setChannelVolume("music", a.music / 100)
audio.setChannelVolume("sfx", a.sfx / 100)
}
func applyControlSettings() {
c = settings.controls
input.rebind("moveForward", c.moveForward)
input.rebind("jump", c.jump)
input.rebind("attack", c.attack)
}
on uiChange("masterSlider", value) {
settings.audio.master = value
applyAudioSettings()
}
on uiChange("qualityDropdown", value) {
settings.graphics.quality = value
applyGraphicsSettings()
}
on uiClick("rebind_moveForward") {
rebindingAction = "moveForward"
ui.setText("rebind_moveForward", "Press a key...")
}
on input("any") {
if rebindingAction != null {
key = input.getLastPressedKey()
settings.controls[rebindingAction] = key
ui.setText("rebind_" + rebindingAction, key)
applyControlSettings()
saveSettings()
rebindingAction = null
}
}
on uiClick("btnResetAll") {
settings = copy(DEFAULT_SETTINGS)
applyAllSettings()
refreshSettingsUI()
saveSettings()
}Node Graph Example
Prefer visual programming? Here is the equivalent Node Graph:
[On Start] --> [Load Settings: merge with defaults]
--> [Apply All: graphics, audio, controls]
[Function: applyGraphics] --> [Set: renderScale, shadows, FOV]
[Function: applyAudio] --> [Set: master, music, sfx volumes]
[Function: applyControls] --> [Rebind: all keys]
[On UIChange "masterSlider"] --> [Update: settings]
--> [Apply Audio] --> [Save Settings]
[On UIClick "rebind_X"] --> [Set: rebindingAction = X]
--> [Wait for key press]
[On Input "any"] --> [Branch: rebinding]
--> [Set: new key] --> [Apply + Save]
[On UIClick "btnResetAll"] --> [Restore defaults]
--> [Apply + Save]Optimization Tips
Keep your implementation fast and efficient with these optimization tips:
- Persist settings to cloud storage. Players expect settings to persist across devices. Save on every change with debounce.
- Apply settings immediately. Do not require restarts. Graphics, audio, and controls can all be applied at runtime.
- Use quality presets instead of individual toggles. Low/Medium/High/Ultra is user-friendly. Most players dont understand shadow maps.
- Merge saved settings with defaults on load. Handles new settings added in updates — missing fields fall back to defaults.
Common Mistakes
Settings require restart
Apply changes immediately. Requiring restarts frustrates players. All Appley settings apply at runtime.
No reset button
Always provide Reset to Defaults. Players can mess up settings and need a way back without reinstalling.
