1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-04 20:53:57 +00:00
Funkin/source/funkin/data/level/LevelData.hx

94 lines
2 KiB
Haxe
Raw Normal View History

package funkin.data.level;
import funkin.data.animation.AnimationData;
/**
* A type definition for the data in a story mode level JSON file.
* @see https://lib.haxe.org/p/json2object/
*/
typedef LevelData =
{
/**
* The version number of the level data schema.
* When making changes to the level data format, this should be incremented,
* and a migration function should be added to LevelDataParser to handle old versions.
*/
2023-05-17 20:42:58 +00:00
@:default(funkin.data.level.LevelRegistry.LEVEL_DATA_VERSION)
var version:String;
/**
* The title of the week, as seen in the top corner.
*/
var name:String;
/**
* The graphic for the level, as seen in the scrolling list.
*/
2023-09-08 21:45:47 +00:00
@:jcustomparse(funkin.data.DataParse.stringNotEmpty)
var titleAsset:String;
@:default([])
var props:Array<LevelPropData>;
@:default(["bopeebo"])
var songs:Array<String>;
@:default("#F9CF51")
@:optional
var background:String;
}
typedef LevelPropData =
{
/**
* The image to use for the prop. May optionally be a sprite sheet.
*/
2023-09-08 21:45:47 +00:00
// @:jcustomparse(funkin.data.DataParse.stringNotEmpty)
var assetPath:String;
/**
* The scale to render the prop at.
* @default 1.0
*/
@:default(1.0)
@:optional
var scale:Float;
2023-05-17 20:42:58 +00:00
/**
* The opacity to render the prop at.
* @default 1.0
*/
@:default(1.0)
@:optional
var alpha:Float;
/**
* If true, the prop is a pixel sprite, and will be rendered without smoothing.
*/
@:default(false)
@:optional
var isPixel:Bool;
/**
* The frequency to bop at, in beats.
2023-05-17 20:42:58 +00:00
* @default 1 = every beat, 2 = every other beat, etc.
*/
2023-05-17 20:42:58 +00:00
@:default(1)
@:optional
2023-05-17 20:42:58 +00:00
var danceEvery:Int;
/**
* The offset on the position to render the prop at.
* @default [0.0, 0.0]
*/
@:default([0, 0])
@:optional
2023-05-17 20:42:58 +00:00
var offsets:Array<Float>;
/**
* A set of animations to play on the prop.
* If default/empty, the prop will be static.
*/
@:default([])
@:optional
var animations:Array<AnimationData>;
}