class CharacterDataParser
package funkin.data.character
import funkin.data.character.CharacterData
Available on all platforms
Static variables
staticfinalread onlyCHARACTER_DATA_VERSION:String = "1.0.1"
The current version string for the stage data format.
Handle breaking changes by incrementing this value
and adding migration to the migrateStageData() function.
- Version 1.0.1 adds
death.cameraOffsets
staticfinalread onlyCHARACTER_DATA_VERSION_RULE:String = "1.0.x"
The current version rule check for the stage data format.
staticfinalread onlyDEFAULT_ATLASSETTINGS:TextureAtlasData = { swfMode : true, cacheOnLoad : false, filterQuality : 1, applyStageMatrix : false, useRenderTexture : false }
staticfinalread onlyDEFAULT_SINGTIME:Float = 8.0
The default time the character should sing for, in steps. Values that are too low will cause the character to stop singing between notes. Values that are too high will cause the character to hold their singing pose for too long after they're done.
Static methods
staticfetchCharacter(charId:String, debug:Bool = false):Null<BaseCharacter>
Fetches data for a character and returns a BaseCharacter instance, ready to be added to the scene.
Parameters:
charId | The character ID to fetch. |
|---|
Returns:
The character instance, or null if the character was not found.
staticfetchCharacterData(charId:String):Null<CharacterData>
Fetches just the character data for a character.
Parameters:
charId | The character ID to fetch. |
|---|
Returns:
The character data, or null if the character was not found.
staticlistCharacterIds():Array<String>
Lists all the valid character IDs.
Returns:
An array of character IDs.
staticloadCharacterCache():Void
Parses and preloads the game's stage data and scripts when the game starts.
If you want to force stages to be reloaded, you can just call this function again.
staticparseCharacterData(charId:String):Null<CharacterData>
Load a character's JSON file and parse its data.
Parameters:
charId | The character to load. |
|---|
Returns:
The character data, or null if validation failed.