The raw underlying data for a song event. This value gets wrapped in an abstract to allow operators to be overloaded.

Constructor

@:value({ value : null })new(time:Float, eventKind:String, ?value:Dynamic)

Variables

@:value(false)@:jignoredactivated:Bool = false

Whether this event has been activated. This is only used internally by the game during gameplay. It should not be serialized.

@:alias("e")eventKind:String

The kind of the event. Examples include "FocusCamera" and "PlayAnimation" Custom events can be added by scripts with the ScriptedSongEvent class.

@:alias("t")time:Float

The timestamp of the event. The timestamp is in the format of the song's time format.

@:value(null)@:alias("v")@:optional@:jcustomparse(funkin.data.DataParse.dynamicValue)@:jcustomwrite(funkin.data.DataWrite.dynamicValue)optionalvalue:Dynamic = null

The data for the event. This can allow the event to include information used for custom behavior. Data type depends on the event kind. It can be anything that's JSON serializable.

Methods

buildTooltip():String

Build the tooltip string for this particular instance of the song event.

Returns:

A tooltip string, containing readable values for the event's data.

clone():SongEventDataRaw

Clone this event data, creating an independent instance with identical data.

Returns:

The newly created event data.

getArray(key:String):Array<Dynamic>

Retrieve a field from this event's data, as an Array<Dynamic> value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getBool(key:String):Null<Bool>

Retrieve a field from this event's data, as a Bool value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getBoolArray(key:String):Array<Bool>

Retrieve a field from this event's data, as an Array<Bool> value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getDynamic(key:String):Null<Dynamic>

Retrieve a field from this event's data, as a Dynamic value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getFloat(key:String):Null<Float>

Retrieve a field from this event's data, as a Float value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getFloatArray(key:String):Array<Float>

Retrieve a field from this event's data, as an Array<Float> value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getHandler():Null<SongEvent>

Retrieve the SongEvent handler class for this event.

Returns:

The handler class, or null if not found.

getInt(key:String):Null<Int>

Retrieve a field from this event's data, as an Int value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getSchema():Null<SongEventSchema>

Retrieve the SongEventSchema for this event.

Returns:

The schema, or null if not found.

@:value({ force : false })getStepTime(force:Bool = false):Float

Get the position of the event in the song, in steps. This value is cached for performance. Use force to require a recalculation.

Parameters:

force

Force the value to be recalculated.

Returns:

The position of the event in the song, in steps.

getString(key:String):String

Retrieve a field from this event's data, as a String value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

getStringArray(key:String):Array<Float>

Retrieve a field from this event's data, as an Array<String> value.

Parameters:

key

The name of the field to retrieve.

Returns:

The field value, or null if not provided.

@:value({ defaultKey : "key" })valueAsStruct(defaultKey:String = "key"):Dynamic