### POST /cutscenes/video/start Source: https://codename-engine.com/api-docs/funkin/game/cutscenes/VideoCutscene Initializes and starts a video cutscene using the VideoCutscene class. ```APIDOC ## POST /cutscenes/video/start ### Description Initializes a new video cutscene substate with a specified file path and a completion callback. ### Method POST ### Endpoint /cutscenes/video/start ### Parameters #### Request Body - **path** (String) - Required - The file path to the video asset. - **callback** (Function) - Required - A function to execute once the video cutscene concludes. ### Request Example { "path": "assets/videos/intro.mp4", "callback": "onCutsceneComplete" } ### Response #### Success Response (200) - **status** (String) - Confirmation that the video has started. #### Response Example { "status": "success", "message": "Video cutscene initialized" } ``` -------------------------------- ### Start Multithreaded Script Source: https://codename-engine.com/api-docs/funkin/backend/utils/EngineUtil Starts a new multithreaded script. This script will share all variables with the current one, and existing callbacks will be replaced on conflict. ```APIDOC ## static startMultithreadedScript(path:String):MultiThreadedScript ### Description Starts a new multithreaded script. This script will share all the variables with the current one, which means already existing callbacks will be replaced by new ones on conflict. ### Method STATIC ### Endpoint N/A (Static method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response - **MultiThreadedScript** (MultiThreadedScript) - The newly started multithreaded script object. #### Response Example ```json { "script_id": "unique_script_identifier" } ``` ``` -------------------------------- ### Conductor Initialization and Song Setup Source: https://codename-engine.com/api-docs/funkin/backend/system/Conductor This section details static methods for initializing the Conductor, mapping BPM changes from song data, and setting up the song. These methods are critical for preparing the engine's timing system before playback begins. ```Haxe static init():Void static mapBPMChanges(song:ChartData):Void static mapCharterBPMChanges(song:ChartData):Void static reset():Void static setupSong(SONG:ChartData):Void ``` -------------------------------- ### FormatUtil Static Method: get(id:String) Source: https://codename-engine.com/api-docs/funkin/backend/utils/translations/FormatUtil The static get method takes a String ID and returns an IFormatInfo object. This is likely used to retrieve formatting information associated with a specific identifier. ```Haxe public static function get(id:String):IFormatInfo { // Implementation details not provided return null; // Placeholder } ``` -------------------------------- ### Start Transition Function Source: https://codename-engine.com/api-docs/funkin/game/PlayState Initiates a state transition, optionally specifying a new state and whether to skip sub-states. Returns a boolean indicating success. ```haxe function startTransition(?newState:FlxState, skipSubStates:Bool = false):Bool ``` -------------------------------- ### Calculate Starting X Position Source: https://codename-engine.com/api-docs/funkin/game/StrumLine A static utility method to calculate the initial X coordinate for a strum line based on HUD ratios, scale, spacing, and key count. ```haxe public static inline function calculateStartingXPos(hudXRatio:Float, scale:Float, spacing:Float, keyCount:Int):Float { // Implementation logic for calculating X position return (hudXRatio * scale) + (spacing * keyCount); } ``` -------------------------------- ### Start Cutscene Function Source: https://codename-engine.com/api-docs/funkin/game/PlayState Initiates a cutscene with customizable parameters. It supports custom prefixes for cutscene files, optional script paths, and callbacks upon completion. The function also includes options to check if a cutscene has already been seen and to skip intro transitions for certain cutscene types. ```haxe function startCutscene(prefix:String = "", ?cutsceneScriptPath:String, ?callback:() -> Void, checkSeen:Bool = false, canSkipTransIn:Bool = true):Void ``` -------------------------------- ### EventManager Static Method: get Source: https://codename-engine.com/api-docs/funkin/backend/scripting/EventManager The static get method retrieves an instance of a specific event class T. It's a generic method that allows fetching event objects based on their class type, facilitating event manipulation. ```haxe class EventManager { static public function get(cl:Class):T { // Implementation details for retrieving event instance return null; // Placeholder } } ``` -------------------------------- ### Constructor: new CharterBookmarkList Source: https://codename-engine.com/api-docs/funkin/editors/charter/CharterBookmarkList Initializes a new instance of the CharterBookmarkList substate. ```APIDOC ## [CONSTRUCTOR] new CharterBookmarkList ### Description Creates a new instance of the bookmark list window for the charter editor. ### Parameters - **scriptsAllowed** (Bool) - Optional - Whether scripts are permitted to run in this substate. - **scriptName** (String) - Optional - The name of the script associated with this substate. ### Request Example new CharterBookmarkList(true, "CustomBookmarkScript"); ``` -------------------------------- ### Display IntroText Source: https://codename-engine.com/api-docs/funkin/menus/IntroText The show method triggers the rendering or animation of the introductory text lines on the screen. It returns Void and requires no parameters. ```haxe intro.show(); ``` -------------------------------- ### Initialize IconOption Source: https://codename-engine.com/api-docs/funkin/options/type/IconOption Constructor for creating a new IconOption instance. It requires a display name, description, icon identifier, and a callback function to execute upon selection. ```Haxe new IconOption(name:String, desc:String, icon:String, callback:() -> Void) ``` -------------------------------- ### GET /cutscenes/video/subtitles Source: https://codename-engine.com/api-docs/funkin/game/cutscenes/VideoCutscene Retrieves or parses subtitles associated with the current video cutscene. ```APIDOC ## GET /cutscenes/video/subtitles ### Description Accesses the subtitles array or triggers the parsing logic for subtitle data within the active VideoCutscene instance. ### Method GET ### Endpoint /cutscenes/video/subtitles ### Response #### Success Response (200) - **subtitles** (Array) - A list of subtitle objects containing text and timing data. #### Response Example { "subtitles": [ { "text": "Hello world", "startTime": 0.5, "endTime": 2.0 } ] } ``` -------------------------------- ### GET /week/loadCharacter Source: https://codename-engine.com/api-docs/funkin/backend/week/Week Retrieves the character configuration data for a specific character name. ```APIDOC ## GET /loadWeekCharacter ### Description Fetches character-specific data required for week rendering. ### Method GET ### Endpoint /loadWeekCharacter ### Parameters #### Query Parameters - **charName** (String) - Required - The name of the character to retrieve. ### Request Example /loadWeekCharacter?charName=bf ### Response #### Success Response (200) - **WeekCharacter** (Object) - The character data object. #### Response Example { "charName": "bf", "assetPath": "characters/bf.json", "scale": 1.0 } ``` -------------------------------- ### Initialize SongCreationScreen Source: https://codename-engine.com/api-docs/funkin/editors/charter/SongCreationScreen The constructor initializes the screen with an optional callback function to handle saving the song data. This is the primary entry point for creating a new song configuration instance. ```haxe new SongCreationScreen(?onSave:(SongCreationData, Null<(String, SongCreationData) -> Void>) -> Void) ``` -------------------------------- ### ModsFolderLibrary Constructor Source: https://codename-engine.com/api-docs/funkin/backend/assets/ModsFolderLibrary Initializes a new instance of the ModsFolderLibrary. ```APIDOC ## ModsFolderLibrary Constructor ### Description Initializes a new instance of the ModsFolderLibrary. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (N/A) N/A #### Response Example N/A ``` -------------------------------- ### GET /script/variable Source: https://codename-engine.com/api-docs/funkin/backend/scripting/Script Retrieves or sets variables within the script's scope. ```APIDOC ## GET /script/variable ### Description Accesses variables stored within the script's internal variable map. ### Method GET ### Endpoint /script/variable ### Parameters #### Query Parameters - **name** (String) - Required - The name of the variable to retrieve. ### Response #### Success Response (200) - **value** (Dynamic) - The value of the requested variable. #### Response Example { "value": 100 } ``` -------------------------------- ### GET /camera/position Source: https://codename-engine.com/api-docs/funkin/game/PlayState Retrieves the camera coordinates for characters or strumlines. ```APIDOC ## GET /camera/position ### Description Calculates and returns the camera position data for specified characters or strumlines. ### Method GET ### Endpoint /camera/position ### Parameters #### Query Parameters - **type** (String) - Required - 'character' or 'strumline'. - **ignoreInvisible** (Bool) - Optional - Whether to ignore invisible targets. ### Response #### Success Response (200) - **x** (Float) - X coordinate. - **y** (Float) - Y coordinate. ``` -------------------------------- ### Initialize NewOption Class Source: https://codename-engine.com/api-docs/funkin/options/type/NewOption The constructor initializes a new instance of the NewOption class. It requires a display name, a description string, and a callback function to execute when the option is selected. ```haxe new(name:String, desc:String, callback:() -> Void) ``` -------------------------------- ### GET /week/load Source: https://codename-engine.com/api-docs/funkin/backend/week/Week Loads the data for a specific week, including optional character data. ```APIDOC ## GET /loadWeek ### Description Loads the configuration and data for a specified week. ### Method GET ### Endpoint /loadWeek ### Parameters #### Query Parameters - **weekName** (String) - Required - The identifier of the week to load. - **loadCharactersData** (Bool) - Optional - Whether to load associated character data (default: true). ### Request Example /loadWeek?weekName=tutorial&loadCharactersData=true ### Response #### Success Response (200) - **WeekData** (Object) - The data object containing week details. #### Response Example { "weekName": "tutorial", "songs": ["tutorial"], "difficulties": ["easy", "normal", "hard"] } ``` -------------------------------- ### Initialize PortraitOption Source: https://codename-engine.com/api-docs/funkin/options/type/PortraitOption Constructor for creating a new PortraitOption instance. It requires a name, description, and callback function, with optional parameters for the portrait graphic, size, and toggle for portrait visibility. ```haxe new(name:String, desc:String, callback:() -> Void, ?graphic:FlxGraphic, size:Int = 96, usePortrait:Bool = true) ``` -------------------------------- ### Constructor: new ModSwitchMenu Source: https://codename-engine.com/api-docs/funkin/menus/ModSwitchMenu Initializes a new instance of the ModSwitchMenu substate with optional script configuration. ```APIDOC ## Constructor: new ModSwitchMenu ### Description Creates a new ModSwitchMenu instance. Allows defining if scripts are permitted and specifying a target script name. ### Parameters - **scriptsAllowed** (Bool) - Optional - Whether scripts are permitted to run in this menu. - **scriptName** (String) - Optional - The name of the script associated with this menu. ### Request Example new ModSwitchMenu(true, "CustomModScript"); ``` -------------------------------- ### GET /duser/avatar Source: https://codename-engine.com/api-docs/funkin/backend/utils/DUser Retrieves the avatar image data for a specific user. ```APIDOC ## GET getAvatar ### Description Retrieves the BitmapData of the user's avatar. ### Method GET ### Parameters #### Query Parameters - **size** (Int) - Optional - The size of the avatar in pixels (default: 256). ### Response #### Success Response (200) - **BitmapData** (Object) - The image data of the user's avatar. ``` -------------------------------- ### Constructor: new TurboKeys Source: https://codename-engine.com/api-docs/funkin/backend/TurboKeys Initializes a new instance of the TurboKeys class to manage specific keyboard inputs. ```APIDOC ## CONSTRUCTOR new(keys, delay, interval, allPress) ### Description Initializes a new TurboKeys object with specified keys and timing configurations. ### Method N/A (Class Constructor) ### Endpoint funkin.backend.TurboKeys ### Parameters #### Path Parameters - **keys** (Array) - Required - The list of keys to monitor. - **delay** (Float) - Optional - Initial delay before input starts. - **interval** (Float) - Optional - Time interval between repeated inputs. - **allPress** (Bool) - Optional - Whether all keys must be pressed. ### Request Example new TurboKeys([FlxKey.LEFT, FlxKey.RIGHT], 0.5, 0.1, false) ### Response #### Success Response - **instance** (TurboKeys) - Returns a new TurboKeys object. ``` -------------------------------- ### GET /events/params Source: https://codename-engine.com/api-docs/funkin/backend/chart/EventsData Retrieves the parameter definitions for a specific event by its name. ```APIDOC ## GET /events/params ### Description Retrieves a list of parameters associated with a specific event name. This is used to validate event inputs dynamically. ### Method GET ### Endpoint /events/params ### Parameters #### Query Parameters - **name** (String) - Required - The unique identifier of the event to query. ### Request Example GET /events/params?name=DANCE ### Response #### Success Response (200) - **params** (Array) - A list of parameter definitions for the requested event. #### Response Example { "params": [ { "name": "intensity", "type": "Number" } ] } ``` -------------------------------- ### Constructor: new(frag, vert, glslVer) Source: https://codename-engine.com/api-docs/funkin/backend/shaders/FunkinShader Initializes a new FunkinShader instance with custom fragment and vertex source code. ```APIDOC ## CONSTRUCTOR new(frag, vert, glslVer) ### Description Creates a new shader from the specified fragment and vertex source. Accepts `#pragma header`. ### Parameters #### Path Parameters - **frag** (String) - Required - Fragment source (pass null to use default) - **vert** (String) - Required - Vertex source (pass null to use default) - **glslVer** (String) - Optional - Version of GLSL to use (defaults to 120) ### Request Example new("void main() { ... }", "void main() { ... }", "120") ``` -------------------------------- ### GET /quantStep Source: https://codename-engine.com/api-docs/funkin/editors/charter/Charter Calculates the quantized step value based on input. ```APIDOC ## GET /quantStep ### Description Handles note drag quantization logic. ### Method GET ### Endpoint /quantStep ### Parameters #### Query Parameters - **step** (Float) - Required - The step value to quantize. ### Response #### Success Response (200) - **Float** - The quantized step value. ``` -------------------------------- ### GET /getWavesToGenerate Source: https://codename-engine.com/api-docs/funkin/editors/charter/Charter Retrieves the list of sound waves currently scheduled for generation. ```APIDOC ## GET /getWavesToGenerate ### Description Fetches an array of sound objects and their names for waveform generation. ### Method GET ### Endpoint /getWavesToGenerate ### Response #### Success Response (200) - **Array<{sound: FlxSound, name: String}>** - List of sound objects. ``` -------------------------------- ### Initialize KeybindSetting Source: https://codename-engine.com/api-docs/funkin/options/keybinds/KeybindSetting Constructor for creating a new KeybindSetting instance. It initializes the UI elements including the key title, current values, and optional icon sprites. ```haxe var keybind = new KeybindSetting(0, 0, "Up", "UP", "arrow_up", "idle", false); ``` -------------------------------- ### Constructor: new UISubstateWindow Source: https://codename-engine.com/api-docs/funkin/editors/ui/UISubstateWindow Initializes a new instance of the UISubstateWindow class with optional script configuration. ```APIDOC ## [CONSTRUCTOR] new UISubstateWindow ### Description Creates a new instance of the UISubstateWindow, allowing for optional script attachment. ### Parameters #### Arguments - **scriptsAllowed** (Bool) - Optional - Whether scripts are permitted to run in this substate. - **scriptName** (String) - Optional - The identifier for the associated script. ### Request Example new UISubstateWindow(true, "MyCustomWindow"); ``` -------------------------------- ### StrumLine Event Listeners Source: https://codename-engine.com/api-docs/funkin/game/StrumLine Examples of how to attach event listeners to StrumLine signals such as onHit, onMiss, and onNoteUpdate. ```haxe strumLine.onHit.add(function(e:NoteHitEvent) { trace("Note hit!"); }); strumLine.onMiss.add(function(e:NoteMissEvent) { trace("Note missed!"); }); strumLine.onNoteUpdate.add(function(e:NoteUpdateEvent) { // Handle note update logic }); ``` -------------------------------- ### Constructor: new(str:String) Source: https://codename-engine.com/api-docs/funkin/backend/utils/translations/StrFormatInfo Initializes a new instance of the StrFormatInfo class with a base string. ```APIDOC ## Constructor: new(str:String) ### Description Creates a new instance of StrFormatInfo to handle string formatting operations. ### Parameters #### Arguments - **str** (String) - Required - The base string to be formatted. ### Usage Example ```haxe var info = new StrFormatInfo("Hello {0}"); ``` ``` -------------------------------- ### Start Dialogue from ScriptedCutscene Source: https://codename-engine.com/api-docs/funkin/game/cutscenes/DialogueCutscene Utilizes the inherited startDialogue method to trigger a dialogue sequence from within a scripted cutscene context. ```haxe this.startDialogue("data/dialogue/level1.json", () -> { // Callback logic here }); ``` -------------------------------- ### TextOption Class Constructor Source: https://codename-engine.com/api-docs/funkin/options/type/TextOption Initializes a new instance of the TextOption class with text, description, and optional callback. ```APIDOC ## Constructor: new(text, desc, suffix, selectCallback) ### Description Creates a new TextOption instance used for UI elements that require display text and associated metadata. ### Parameters - **text** (String) - Required - The primary text displayed for the option. - **desc** (String) - Required - The description text associated with the option. - **suffix** (String) - Optional - A suffix appended to the text (default: ""). - **selectCallback** (() -> Void) - Optional - A function executed when the option is selected. ### Request Example new TextOption("Volume", "Adjust game volume", "%", () -> { trace("Selected"); }); ``` -------------------------------- ### Get Key State Source: https://codename-engine.com/api-docs/funkin/editors/ui/UIUtil Retrieves the current input state of a specific FlxKey. Returns true if the key matches the provided FlxInputState. ```haxe static function getKeyState(key:FlxKey, Status:FlxInputState):Bool; ``` -------------------------------- ### IconOption Constructor Source: https://codename-engine.com/api-docs/funkin/options/type/IconOption Initializes a new instance of the IconOption class. ```APIDOC ## new IconOption ### Description Initializes a new instance of the IconOption class with a name, description, icon, and a callback function. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "new IconOption(name='Example', desc='An example option', icon='path/to/icon.png', callback=function() { trace('Option selected!'); })" } ``` ### Response #### Success Response (200) N/A #### Response Example ```json { "example": "N/A" } ``` ``` -------------------------------- ### Get Animation Data Source: https://codename-engine.com/api-docs/funkin/game/HealthIcon Retrieves the animation data for a specific health percentage. Returns an IconAnimData object or -1 if the input is invalid. ```haxe var animData = icon.dynamicgetIconAnim(0.5); ``` -------------------------------- ### Get Amp Square Root (Haxe) Source: https://codename-engine.com/api-docs/funkin/editors/charter/CharterWaveformHandler Retrieves the read-only integer value of ampSqrt. This is likely related to amplitude calculations for waveforms. ```Haxe function get_ampSqrt():Int ``` -------------------------------- ### Define Player 1 Input Mappings Source: https://codename-engine.com/api-docs/funkin/options/Options Static arrays of FlxKey values defining the default control scheme for Player 1. These mappings cover menu navigation, note inputs, and system development shortcuts. ```Haxe static var P1_ACCEPT:Array = [ENTER]; static var P1_DOWN:Array = [S]; static var P1_LEFT:Array = [A]; static var P1_RIGHT:Array = [D]; static var P1_UP:Array = [W]; static var P1_PAUSE:Array = [ENTER]; ``` -------------------------------- ### Initialize TextOption Source: https://codename-engine.com/api-docs/funkin/options/type/TextOption Constructor for the TextOption class. It initializes the option with a display text, a description, an optional suffix, and a callback function triggered upon selection. ```Haxe new(text:String, desc:String, suffix:String = "", ?selectCallback:() -> Void) ``` -------------------------------- ### Retrieve FreeplaySonglist instance Source: https://codename-engine.com/api-docs/funkin/menus/FreeplaySonglist Static method to get the singleton instance of FreeplaySonglist. Accepts a boolean parameter to determine if text-based assets should be included. ```haxe static function get(useTxt:Bool = true):FreeplaySonglist ``` -------------------------------- ### Initialize DialogueCutscene Source: https://codename-engine.com/api-docs/funkin/game/cutscenes/DialogueCutscene Demonstrates how to instantiate a new DialogueCutscene object by providing a path to the dialogue data and an optional callback function to execute upon completion. ```haxe var dialogue = new DialogueCutscene("data/dialogue/intro.json", function() { trace("Dialogue finished!"); }); ``` -------------------------------- ### Get XML Attribute Utility Source: https://codename-engine.com/api-docs/funkin/backend/utils/CoolUtil Retrieves an XML attribute from an Access abstract safely without throwing exceptions. Returns null if the attribute is missing. ```haxe public static inline function getAtt(xml:Access, name:String):Null> { return xml.getAtt(name); } ``` -------------------------------- ### Initialize FreeplaySonglist Source: https://codename-engine.com/api-docs/funkin/menus/FreeplaySonglist Constructor for creating a new instance of the FreeplaySonglist class. ```haxe function new() ``` -------------------------------- ### Constructor - CreditsMain Source: https://codename-engine.com/api-docs/funkin/menus/credits/CreditsMain Initializes a new instance of the CreditsMain menu state. ```APIDOC ## Constructor: new CreditsMain ### Description Creates a new CreditsMain menu instance with optional exit callbacks and script configurations. ### Parameters - **exitCallback** (TreeMenu -> Void) - Optional - Callback function triggered when exiting the menu. - **scriptsAllowed** (Bool) - Optional - Whether scripts are permitted to run in this state. - **scriptName** (String) - Optional - The name of the script associated with this state. ### Request Example new CreditsMain(myExitFunc, true, "CreditsScript"); ``` -------------------------------- ### Get and Set Property Values Source: https://codename-engine.com/api-docs/funkin/backend/utils/PropertyInfo Methods to retrieve or modify the value of the property encapsulated by the PropertyInfo instance. getValue returns the current Dynamic value, while setValue updates it. ```haxe var val = prop.getValue(); prop.setValue(newValue); ``` -------------------------------- ### SoundTrayShowEvent Constructor Source: https://codename-engine.com/api-docs/funkin/backend/scripting/events/soundtray/SoundTrayShowEvent Initializes a new instance of the SoundTrayShowEvent class. ```APIDOC ## new() ### Description Initializes a new instance of the SoundTrayShowEvent class. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ``` -------------------------------- ### MusicBeatState Inherited Methods Source: https://codename-engine.com/api-docs/funkin/menus/WarningState Methods inherited by WarningState from MusicBeatState, including calling functions by name, event handling, linear interpolation, opening sub-states, and starting transitions. ```Haxe function call(name:String, ?args:Array, ?defaultVal:Dynamic):Dynamic function event(name:String, event:T):T function lerp(v1:Float, v2:Float, ratio:Float, fpsSensitive:Bool = false):Float function openSubState(subState:FlxSubState):Void function startTransition(?newState:FlxState, skipSubStates:Bool = false):Bool ``` -------------------------------- ### Initialize KeybindsOptions Substate Source: https://codename-engine.com/api-docs/funkin/options/keybinds/KeybindsOptions Constructor for the KeybindsOptions class. It accepts optional parameters for script management. ```haxe var keybinds = new KeybindsOptions(true, "CustomScript"); ``` -------------------------------- ### Get Splash Group (Haxe) Source: https://codename-engine.com/api-docs/funkin/game/SplashHandler Retrieves a specific splash group by its name. If the group does not exist, it is created. This method is essential for accessing and managing individual splash screen collections. ```Haxe public function getSplashGroup(name:String):Null { if (!grpMap.exists(name)) { var splashGroup = new SplashGroup(); grpMap.set(name, splashGroup); return splashGroup; } return grpMap.get(name); } ``` -------------------------------- ### HiddenProcess Constructor Source: https://codename-engine.com/api-docs/funkin/backend/utils/native/HiddenProcess Initializes a new system process instance. ```APIDOC ## POST /native/process/new ### Description Creates a new instance of a system process. ### Method POST ### Endpoint /native/process/new ### Parameters #### Request Body - **cmd** (String) - Required - The command to execute. - **args** (Array) - Optional - Arguments to pass to the command. - **detached** (Bool) - Optional - Whether the process should run detached from the parent. ``` -------------------------------- ### UISoftcodedWindow Constructor Source: https://codename-engine.com/api-docs/funkin/editors/ui/UISoftcodedWindow Initializes a new instance of the UISoftcodedWindow class. ```APIDOC ## new(xmlPath:String, ?customVariables:Map) ### Description Initializes a new instance of the UISoftcodedWindow class. ### Method CONSTRUCTOR ### Parameters #### Path Parameters - **xmlPath** (String) - Required - The path to the XML file. - **customVariables** (Map) - Optional - A map of custom variables. ### Response #### Success Response (200) - **Void** - The constructor does not return a value. ``` -------------------------------- ### Retrieve Chart Information (Haxe) Source: https://codename-engine.com/api-docs/funkin/editors/charter/Charter Functions to retrieve specific data from the chart. This includes getting a list of bookmarks and identifying the strum line ID based on its data. ```Haxe public function getBookmarkList():Array ``` ```Haxe public function getStrumlineID(strL:ChartStrumLine):Int ``` -------------------------------- ### Get ID Method Source: https://codename-engine.com/api-docs/funkin/editors/character/CharacterSelectionScreen The `getID` method is an inline helper function to retrieve an identifier based on a given name. This is likely used for internal referencing or data retrieval. This method is inherited from TreeMenuScreen. ```haxe function inlinegetID(name:String):String ``` -------------------------------- ### Accessing SystemInfo Static Properties Source: https://codename-engine.com/api-docs/funkin/backend/system/framerate/SystemInfo The SystemInfo class provides static string variables to retrieve hardware and system information. These values are initialized via the init() method and default to 'Unknown' if not populated. ```Haxe import funkin.backend.system.framerate.SystemInfo; // Initialize system metrics SystemInfo.init(); // Access hardware information trace("CPU: " + SystemInfo.cpuName); trace("GPU: " + SystemInfo.gpuName); trace("OS: " + SystemInfo.osInfo); ``` -------------------------------- ### Recycle PlayAnimEvent Source: https://codename-engine.com/api-docs/funkin/backend/scripting/events/sprite/PlayAnimEvent The recycle method allows for the reuse of event objects to reduce garbage collection overhead. It accepts parameters for animation name, force state, reverse playback, starting frame, and context. ```haxe event.recycle("idle", true, false, 0, context); ``` -------------------------------- ### Initialize Note Instance Source: https://codename-engine.com/api-docs/funkin/game/Note Constructor for creating a new Note instance. It requires references to the StrumLine and ChartNote data, with optional parameters for sustain properties and the previous note in the sequence. ```Haxe new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0, ?prev:Note) ``` -------------------------------- ### Get Description ID Method Source: https://codename-engine.com/api-docs/funkin/editors/character/CharacterSelectionScreen The `getDescID` method is an inline helper function to retrieve a description identifier based on a given name. This is useful for localization and UI text management. This method is inherited from TreeMenuScreen. ```haxe function inlinegetDescID(name:String):String ``` -------------------------------- ### MusicBeatSubstate Constructor Source: https://codename-engine.com/api-docs/funkin/backend/MusicBeatSubstate Initializes a new instance of the MusicBeatSubstate class, allowing for script management and custom script names. ```APIDOC ## new(scriptsAllowed:Bool = true, ?scriptName:String) ### Description Initializes a new instance of the MusicBeatSubstate class. ### Method CONSTRUCTOR ### Parameters #### Path Parameters - **scriptsAllowed** (Bool) - Optional - Determines if scripts are allowed for this substate. Defaults to true. - **scriptName** (String) - Optional - Specifies a custom script name for this substate. ### Request Example ```json { "scriptsAllowed": true, "scriptName": "myCustomScript" } ``` ### Response #### Success Response (200) - **Void** - The constructor does not return a value. ``` -------------------------------- ### Get Text Formats from XML (Haxe) Source: https://codename-engine.com/api-docs/funkin/backend/utils/XMLUtil Retrieves text formatting information from an XML node, supporting inline formatting tags like ``. It parses attributes such as color to reconstruct the text styles. ```Haxe function getTextFormats(_node:OneOfTwo, ?currentFormat:Dynamic, ?parsedSegments:Array):Array ``` -------------------------------- ### NoteGroup Constructor and Methods Source: https://codename-engine.com/api-docs/funkin/game/NoteGroup API reference for initializing the NoteGroup and managing note collections. ```APIDOC ## Constructor: new(?MaxSize:Int) ### Description Initializes a new instance of the NoteGroup class. ### Parameters #### Path Parameters - **MaxSize** (Int) - Optional - The maximum number of notes the group can hold. --- ## Method: addNotes(notes:Array) ### Description Adds an array of notes to the group and automatically sorts them by their timing. ### Parameters #### Request Body - **notes** (Array) - Required - The list of note objects to add to the group. --- ## Method: get(id:Int) ### Description Retrieves a specific note from the group by its ID. ### Parameters #### Query Parameters - **id** (Int) - Required - The unique identifier of the note. ### Response #### Success Response (200) - **Note** (Object) - The requested note object. --- ## Method: preallocate(len:Int) ### Description Preallocates the internal members array to a specific length to optimize memory usage. ### Parameters #### Query Parameters - **len** (Int) - Required - The number of slots to preallocate. --- ## Method: sortNotes() ### Description Manually triggers a sort of the notes currently contained within the group. ``` -------------------------------- ### Initialize IntroText Class Source: https://codename-engine.com/api-docs/funkin/menus/IntroText The constructor initializes the IntroText object with an optional array of lines. Each line can be either a string or a TitleStateImage object. ```haxe var intro = new IntroText(["Welcome", "To The Game"]); ``` -------------------------------- ### Inherited Methods from FunkinSprite (Haxe) Source: https://codename-engine.com/api-docs/funkin/editors/character/CharacterGhost Details methods inherited from FunkinSprite for animation manipulation, including adding, getting, removing, and stopping animations, as well as sprite loading and offset management. ```Haxe inlineaddAnim(name:String, prefix:String, frameRate:Float = 24, ?looped:Bool, ?forced:Bool, ?indices:Array, x:Float = 0, y:Float = 0, animType:XMLAnimType = NONE):ErrorCode ``` ```Haxe addOffset(name:String, x:Float = 0, y:Float = 0):Void ``` ```Haxe copyAtlasValues():Void ``` ```Haxe getAnim(name:String):OneOfTwo ``` ```Haxe inlinegetAnimName():String ``` ```Haxe inlinegetAnimOffset(name:String):Null ``` ```Haxe inlinegetNameList():Array ``` ```Haxe inlinehasAnim(AnimName:String):Bool ``` ```Haxe inlinehasAnimation(AnimName:String):Bool ``` ```Haxe inlineisAnimAtEnd():Bool ``` ```Haxe inlineisAnimFinished():Bool ``` ```Haxe inlineisAnimReversed():Bool ``` ```Haxe loadSprite(path:String, Unique:Bool = false, ?Key:String):FunkinSprite ``` ```Haxe onPropertySet(property:String, value:Dynamic):Void ``` ```Haxe inlineremoveAnim(name:String):Void ``` ```Haxe inlineremoveAnimation(name:String):Void ``` ```Haxe inlinestopAnim():Void ``` ```Haxe inlinestopAnimation():Void ``` ```Haxe switchOffset(anim1:String, anim2:String):Void ``` -------------------------------- ### Initialize Shader Resize Fix Source: https://codename-engine.com/api-docs/funkin/backend/utils/ShaderResizeFix The init method prepares the ShaderResizeFix utility for use within the engine. This should be called during the application startup sequence. ```haxe static function init():Void; ``` -------------------------------- ### Add XML Animation to Sprite (Haxe) Source: https://codename-engine.com/api-docs/funkin/backend/utils/XMLUtil Adds an animation to a sprite directly from an XML node representing the animation. This method allows for flexible animation setup by parsing XML structures, with an option to control looping. ```Haxe function addXMLAnimation(sprite:FlxSprite, anim:Access, loop:Bool = false):ErrorCode ``` -------------------------------- ### Initialize FreeplayState Source: https://codename-engine.com/api-docs/funkin/menus/FreeplayState Constructor for the FreeplayState class. It accepts optional parameters to define script permissions and a specific script name for custom state behavior. ```haxe public function new(?scriptsAllowed:Bool = true, ?scriptName:String = null) ``` -------------------------------- ### Get Name ID Method Source: https://codename-engine.com/api-docs/funkin/editors/character/CharacterSelectionScreen The `getNameID` method is an inline helper function to retrieve a name identifier based on a given name. This could be used for display purposes or unique naming conventions. This method is inherited from TreeMenuScreen. ```haxe function inlinegetNameID(name:String):String ``` -------------------------------- ### DialogueBox Methods for Text and Animation Source: https://codename-engine.com/api-docs/funkin/game/cutscenes/dialogue/DialogueBox Provides methods for interacting with the dialogue box, including playing animations, displaying character portraits, resetting text, and starting text display with customizable speed and sound effects. ```haxe public function playBubbleAnim(bubble:String, suffix:String = "", text:String = "", ?format:Array, speed:Float = 0.05, ?customSFX:FlxSound, ?customTypeSFX:Array, setTextAfter:Bool = false, allowDefault:Bool = true):Void { // Method logic here } public function popupChar(char:DialogueCharacter, force:Bool = false):Void { // Method logic here } public function resetText(text:String = "", ?formats:Array, ?event:DialogueBoxSetTextEvent):Void { // Method logic here } public function startText(text:String = "", ?format:Array, speed:Float = 0.05, ?customTypeSFX:Array):Void { // Method logic here } ``` -------------------------------- ### POST /script/create Source: https://codename-engine.com/api-docs/funkin/backend/scripting/Script Creates a new script instance from a file path or raw string content. ```APIDOC ## POST /script/create ### Description Creates a script instance from a specified asset path or raw code string. The engine automatically detects the language based on the file extension. ### Method POST ### Endpoint /script/create ### Parameters #### Request Body - **path** (String) - Required - Path to the script file in assets. - **code** (String) - Optional - Raw script content if creating from string. ### Request Example { "path": "scripts/my_mod.hx" } ### Response #### Success Response (200) - **script** (Object) - The initialized Script object. #### Response Example { "status": "success", "script": { "fileName": "my_mod.hx", "path": "scripts/my_mod.hx" } } ``` -------------------------------- ### Get Character List (Haxe) Source: https://codename-engine.com/api-docs/funkin/game/Character Static method to retrieve a list of characters available in the game. It can optionally include mods and subfolders, and allows specifying a custom directory for character data. Returns an array of strings, where each string is a character name. ```haxe public static function getList(mods:Bool = false, includeFolders:Bool = false, folder:String = "data/characters/"):Array ``` -------------------------------- ### UITopMenuButton Constructor Source: https://codename-engine.com/api-docs/funkin/editors/ui/UITopMenuButton Initializes a new instance of the UITopMenuButton class. It requires position (x, y), a parent UITopMenu, a label string, and an array of UIContextMenuOption for its context menu. ```haxe new(x:Float, y:Float, parent:UITopMenu, label:String, contextMenu:Array) ``` -------------------------------- ### Get Icon from Character Name (Haxe) Source: https://codename-engine.com/api-docs/funkin/game/Character Static method to retrieve the icon path for a given character name. If the character is not found or has no specific icon defined, it returns a default icon path. This is useful for displaying character portraits or icons in the UI. ```haxe public static function getIconFromCharName(?character:String, ?defaultIcon:String):String ``` -------------------------------- ### Static Void Methods Source: https://codename-engine.com/api-docs/funkin/options/Options These static void methods represent core engine operations. They include flushing, loading, saving, and applying settings or keybinds. ```Haxe static__flush():Void static__load():Void staticapplyKeybinds():Void staticapplySettings():Void staticload():Void staticsave():Void ``` -------------------------------- ### Get XML from Character Name (Haxe) Source: https://codename-engine.com/api-docs/funkin/game/Character Static method to retrieve the XML data associated with a given character name. This XML typically contains animation and configuration details for the character. It can accept either a string (character name) or a Character object as input. ```haxe public static function getXMLFromCharName(character:OneOfTwo):Access ``` -------------------------------- ### FormatUtil Static Method: getStr(id:String) Source: https://codename-engine.com/api-docs/funkin/backend/utils/translations/FormatUtil The static getStr method, similar to get(), takes a String ID and returns an IFormatInfo object. The 'Str' suffix might imply a specific type of string formatting or retrieval. ```Haxe public static function getStr(id:String):IFormatInfo { // Implementation details not provided return null; // Placeholder } ``` -------------------------------- ### StageSelectionScreen Inherited Methods from TreeMenuScreen Source: https://codename-engine.com/api-docs/funkin/editors/stage/StageSelectionScreen Details inherited methods from TreeMenuScreen, such as changing selection, closing the screen, getting description/ID/name translations, reloading strings, translating text, updating items, and updating the menu description. These methods manage the screen's lifecycle and user interaction. ```Haxe class StageSelectionScreen extends EditorTreeMenuScreen { // ... other properties and methods ... // Inherited from TreeMenuScreen public function changeSelection(change:Int, force:Bool = false):Void { /* ... */ } public function close():Void { /* ... */ } public function inlinegetDescID(name:String):String { /* ... */ } public function inlinegetID(name:String):String { /* ... */ } public function inlinegetNameID(name:String):String { /* ... */ } public function reloadStrings():Void { /* ... */ } public function translate(name:String, ?args:Array):String { /* ... */ } public function updateItems(force:Bool = false):Void { /* ... */ } public function updateMenuDesc(?customTxt:String):Void { /* ... */ } } ``` -------------------------------- ### Static Options Menu Configuration (Haxe) Source: https://codename-engine.com/api-docs/funkin/options/OptionsMenu Defines the static array `mainOptions` which configures the main options menu. Each element in the array represents a category with properties for name, description, and the associated state or substate to open. ```Haxe staticmainOptions:Array = [{ name : "optionsTree.controls-name", desc : "optionsTree.controls-desc", suffix : "", substate : funkin.options.keybinds.KeybindsOptions }, { name : "optionsTree.gameplay-name", desc : "optionsTree.gameplay-desc", state : GameplayOptions }, { name : "optionsTree.appearance-name", desc : "optionsTree.appearance-desc", state : AppearanceOptions }, { name : "optionsTree.language-name", desc : "optionsTree.language-desc", state : LanguageOptions }, { name : "optionsTree.miscellaneous-name", desc : "optionsTree.miscellaneous-desc", state : MiscOptions }] ``` -------------------------------- ### Initialize SaveSubstate Source: https://codename-engine.com/api-docs/funkin/editors/SaveSubstate Constructs a new instance of SaveSubstate. It requires a data string and optional configuration objects for save options and substate data. ```haxe var saveSubstate = new SaveSubstate("save_data_string", options, saveOptions); ``` -------------------------------- ### UITopMenuButton Methods Source: https://codename-engine.com/api-docs/funkin/editors/ui/UITopMenuButton Contains methods for managing the button's functionality, including opening its associated context menu. ```haxe openContextMenu():Void ``` -------------------------------- ### Get Registry String Value - C++ Source: https://codename-engine.com/api-docs/funkin/backend/utils/RegistryUtil Retrieves a string value from the Windows Registry. It takes the registry hive, subkey path, and value name. Returns the string value or null if an error occurs or the value is not found. Requires Windows API headers. ```cpp #include #include #include #include HKEY hKey; LONG result; DWORD dataSize = 0; DWORD dataType = 0; std::wstring subkey = std::wstring(key.wchar_str()); std::wstring valname = std::wstring(string.wchar_str()); result = RegOpenKeyExW((HKEY)reinterpret_cast(static_cast(hive)), subkey.c_str(), 0, KEY_READ, &hKey); if (result != ERROR_SUCCESS) return null(); result = RegQueryValueExW(hKey, valname.c_str(), NULL, &dataType, NULL, &dataSize); if (result != ERROR_SUCCESS || dataSize == 0) { RegCloseKey(hKey); return null(); } std::vector buffer(dataSize / sizeof(wchar_t)); result = RegQueryValueExW(hKey, valname.c_str(), NULL, NULL, (LPBYTE)buffer.data(), &dataSize); RegCloseKey(hKey); if (result == ERROR_SUCCESS) { return ::String(buffer.data()); } return null(); ``` -------------------------------- ### Manage Intro Text Source: https://codename-engine.com/api-docs/funkin/menus/TitleState Methods for controlling the display of intro text sequences. These include adding, creating, and clearing text elements on the screen. ```haxe function addMoreText(text:String):Void; function createCoolText(textArray:Array):Void; function deleteCoolText():Void; ``` -------------------------------- ### Initialize PropertyInfo Instance Source: https://codename-engine.com/api-docs/funkin/backend/utils/PropertyInfo Constructs a new PropertyInfo object to track a specific field within a dynamic object. It requires the target object and the field identifier, which can be either a String or an Int. ```haxe var prop = new PropertyInfo(myObject, "fieldName"); ``` -------------------------------- ### Initialize CharterEventScreen Source: https://codename-engine.com/api-docs/funkin/editors/charter/CharterEventScreen Constructor for creating a new instance of the CharterEventScreen. It requires the current step, a global flag, and an optional existing chart event. ```Haxe var eventScreen = new CharterEventScreen(step, global, chartEvent); ``` -------------------------------- ### Initialize PropertyButton Source: https://codename-engine.com/api-docs/funkin/editors/extra/PropertyButton Constructs a new PropertyButton instance. It requires a property key, a value, and a parent reference to handle removal, with optional parameters for sizing and layout. ```Haxe var btn = new PropertyButton("speed", "1.0", parentObject, 280, 35, 100, 135, 25); ``` -------------------------------- ### TextOption Variables and Methods Source: https://codename-engine.com/api-docs/funkin/options/type/TextOption Details the available properties and inherited methods for managing TextOption instances. ```APIDOC ## Variables - **suffix** (String) - The suffix string attached to the option. - **selectCallback** (() -> Void) - The callback function triggered on selection. ## Inherited Variables (from OptionType) - **desc** (String) - The description of the option. - **text** (String) - The main display text. - **selected** (Bool) - Current selection state. - **locked** (Bool) - Whether the option is locked. ## Methods - **changeSelection(change:Int):Void** - Updates the selection state based on the provided integer change. - **reloadStrings():Void** - Refreshes the display strings for the option. ``` -------------------------------- ### Manage Context Menus Source: https://codename-engine.com/api-docs/funkin/editors/UIDebugState Opens a context menu with a list of options and an optional callback function. This method is inherited from UIState and allows for dynamic UI interaction. ```haxe openContextMenu(options:Array, ?callback:Null, ?x:Float, ?y:Float, ?w:Int):UIContextMenu; ``` -------------------------------- ### Initialize SliderOption Source: https://codename-engine.com/api-docs/funkin/options/type/SliderOption Constructor for creating a new SliderOption instance. It requires a label, description, range boundaries, and an optional callback to handle value updates. ```haxe var volumeSlider = new SliderOption( "Volume", "Adjust the master volume", 0.0, 1.0, 0.1, null, "master_volume", 200, function(val:Float) { trace("New volume: " + val); } ); ``` -------------------------------- ### CreditsMain.startTransition Method (Inherited from MusicBeatState) Source: https://codename-engine.com/api-docs/funkin/menus/credits/CreditsMain Initiates a state transition, optionally to a new FlxState. It can also skip sub-states during the transition. ```Haxe public function startTransition(?newState:FlxState, skipSubStates:Bool = false):Bool ``` -------------------------------- ### Initialize GameOverSubstate Source: https://codename-engine.com/api-docs/funkin/game/GameOverSubstate Constructor for the GameOverSubstate class. It initializes the substate with position coordinates, character selection, and optional overrides for game over music and sound effects. ```haxe new GameOverSubstate(x:Float, y:Float, ?character:String, player:Bool = true, ?gameOverSong:String, ?lossSFX:String, ?retrySFX:String) ``` -------------------------------- ### FunkinGame Constructor Source: https://codename-engine.com/api-docs/funkin/backend/system/FunkinGame Initializes a new instance of the FunkinGame class. It allows for customization of game dimensions, initial state, framerates, and splash screen behavior. ```Haxe public function new(?gameWidth:Int, ?gameHeight:Int, ?initialState:Class, ?updateFramerate:Int, ?drawFramerate:Int, ?skipSplash:Bool, ?startFullscreen:Bool) ``` -------------------------------- ### TranslatedAssetLibrary Constructor Source: https://codename-engine.com/api-docs/funkin/backend/assets/TranslatedAssetLibrary Initializes a new instance of the TranslatedAssetLibrary class. It requires an IModsAssetLibrary instance and optionally accepts a language folder string. ```actionscript public function TranslatedAssetLibrary(lib:IModsAssetLibrary, ?langFolder:String) ``` -------------------------------- ### Initialize UINumericStepper Source: https://codename-engine.com/api-docs/funkin/editors/ui/UINumericStepper Constructor for creating a new UINumericStepper instance. It allows defining the initial value, step increment, precision, and optional min/max constraints. ```haxe var stepper = new UINumericStepper(10, 10, 0, 1, 0, 0, 100, 180, 32, false); ```