Skip to main content
The Preferences class provides a centralized store for user-configurable, globally relevant settings. All preferences are automatically persisted to the save file.

Overview

Preferences manages settings such as:
  • Display settings (framerate, VSync, debug display)
  • Gameplay settings (downscroll, flashing lights, camera zoom)
  • Accessibility options (naughtyness filter, subtitles)
  • Audio/visual offsets for input lag compensation
  • Mobile-specific settings (haptics, screen timeout, controls)
All properties are implemented as static getters/setters that automatically load from and save to the user’s save file.

Display Settings

framerate

Target frames per second for the game.
  • Web: Always returns 60 (cannot be changed)
  • Mobile: Returns the device’s display refresh rate (minimum 60)
  • Desktop: User-configurable (default: 60)
Example:

vsyncMode

VSync mode setting.
WindowVSyncMode
default:"OFF"
Possible values: OFF, ON, ADAPTIVE
Example:

unlockedFramerate

Unlocks the framerate cap on web builds.
Bool
default:"false"
Web only. Removes the requestAnimationFrame cap.
Example:

debugDisplay

Controls the debug FPS/memory counter visibility.
DebugDisplayMode
default:"Off"
Possible values: Off, On, Advanced
Example:

debugDisplayBGOpacity

Background opacity for the debug display.
Int
default:"50"
Value from 0-100 representing background opacity percentage.
Example:

Gameplay Settings

downscroll

Places the strumline at the bottom of the screen instead of the top.
Bool
default:"false"
Desktop default: false. Mobile default: true.
Example:

flashingLights

Controls the intensity of flashing lights effects.
Bool
default:"true"
When false, flashing lights in menus and gameplay are less intense.
Example:

zoomCamera

Enables camera zoom synchronized to the beat.
Bool
default:"true"
When true, the camera bumps on beats during gameplay.
Example:

naughtyness

Controls whether explicit language is displayed.
Bool
default:"true"
When false, filters explicit content. Always false if compiled with NO_FEATURE_NAUGHTYNESS.
Example:

subtitles

Enables subtitles during songs and cutscenes.
Bool
default:"true"
When true, displays subtitles when available.
Example:

Audio/Visual Settings

globalOffset

Global audio offset to compensate for input lag.
Int
default:"0"
Offset in milliseconds. Positive values make notes appear earlier.
Example:

strumlineBackgroundOpacity

Opacity of the background behind the notes.
Int
default:"0"
Value from 0-100. 0 = transparent, 100 = fully opaque black.
Example:

System Settings

autoPause

Automatically pauses the game when tabbing out.
Bool
default:"true"
When true, game pauses on focus loss. Always false on mobile.
Example:

autoFullscreen

Automatically launches in fullscreen on startup.
Bool
default:"true"
When true, game starts in fullscreen mode.
Example:

Screenshot Settings

shouldHideMouse

Hides the mouse cursor when taking screenshots.
Bool
default:"true"
When true, mouse cursor is hidden during screenshot capture.

fancyPreview

Shows a preview after taking a screenshot.
Bool
default:"true"
When true, displays an animated preview of the screenshot.

previewOnSave

Only shows preview after the screenshot is successfully saved.
Bool
default:"true"
When true, preview only appears after save completes.
Example:

Mobile Settings

These settings are only available when compiled with mobile support (#if mobile).

hapticsMode

Controls haptic feedback mode.
HapticsMode
default:"All"
Possible values: NONE, NOTES_ONLY, ALL
Example:

hapticsIntensityMultiplier

Multiplier for haptic feedback intensity.
Float
default:"1.0"
Multiplier for all haptic effects. Higher values = stronger vibration.
Example:

screenTimeout

Allows the device screen to sleep.
Bool
default:"false"
When false, prevents screen from sleeping during gameplay.
Example:

controlsScheme

Control scheme for the hitbox on mobile.
String
default:"Arrows"
Control layout type. Default is arrow key layout.
Example:

Initialization

init()

Initializes preferences and applies saved settings.
This method is called automatically during game startup. It:
  • Applies the autoPause setting
  • Sets up the debug display
  • Configures framerate caps
  • Sets mobile-specific options
Example:

Example: Settings Menu

Example: Performance Optimization

Best Practices

Auto-Save

Preferences automatically save when changed. No manual save call needed:

Platform-Specific Settings

Check platform before setting platform-specific preferences:

Validation

Validate user input when allowing custom values:

See Also