Overview
The song event system allows chart creators to trigger gameplay changes at specific points in a song. Events can control camera focus, zoom, character swaps, stage changes, and more.Class Hierarchy
SongEvent
Base class for all song events.Properties
String
Unique identifier for this event type
Bool
default:"false"
If true, events are handled even when skipping forward in the song
Methods
new(id:String, ?params:SongEventParams)
Creates a new event handler.
String
required
Event type identifier
SongEventParams
Optional parameters (processOldEvents)
handleEvent(data:SongEventData):Void
Handles the event when it’s triggered. Must be overridden.
getEventSchema():SongEventSchema
Returns the chart editor schema for this event.
getTitle():String
Returns the human-readable title.
getIconPath():String
Returns the path to the event’s icon.
Built-in Events
FocusCameraSongEvent
Changes camera focus to a character or position.Event Data
Int
default:"0"
Target: -1 (Position), 0 (Player/BF), 1 (Opponent/Dad), 2 (Girlfriend)
Float
default:"0"
X offset or absolute X position
Float
default:"0"
Y offset or absolute Y position
Float
default:"4.0"
Tween duration in steps
String
default:"CLASSIC"
Easing function: linear, INSTANT, CLASSIC, sine, quad, cube, etc.
String
default:"In"
Easing direction: In, Out, InOut
Examples
ZoomCameraSongEvent
Changes camera zoom level.Event Data
Float
default:"1.0"
Target zoom level
Float
default:"4.0"
Tween duration in steps
String
default:"direct"
“stage” (relative to stage zoom) or “direct” (absolute)
String
default:"linear"
Easing function
String
default:"In"
Easing direction
Examples
Other Built-in Events
SetCharacterSongEvent- Swaps a character mid-song
- Useful for character transformations
- Changes the entire stage
- Can trigger scene transitions
- Forces a character to play a specific animation
- Useful for cutscenes
- Changes scroll speed mid-song
- Can speed up or slow down gameplay
- Controls camera bop intensity
- Affects camera “bounce” on beats
- Changes a character’s health icon
- Useful for character transformations
Creating Custom Events
Basic Custom Event
Advanced Custom Event
Event Data Access
Reading Event Values
Event Schema Types
Field Types
Schema Example
Easing Functions
Available easing functions from FlxEase:linearsine,quad,cube,quart,quintexpo,circ,back,bounce,elasticsmoothStep,smootherStep
In- Slow start, fast endOut- Fast start, slow endInOut- Slow start and end
Usage in Charts
Chart JSON Format
Float
required
Event timestamp in milliseconds
String
required
Event type ID
Dynamic
required
Event-specific values/parameters
Best Practices
Event schemas are used by the chart editor to provide a user-friendly interface. Well-defined schemas make events easier to use.
