Skip to content

`Backend: Helper

GhostglowDev edited this page Mar 21, 2024 · 1 revision
local hlp = require "ghostutil._backend.helper"

See source code

getCameraFromString(cam:String) -> String

Returns the camera name based on the cam argument. If unknown, camGame is returned

serialize(value:Any, type:String) -> String

Used to serialize table and strings to haxe

retTbl(value:Any, index:Int, ?suffix:String = '') -> Any

If value is a table, then it returns value[index]. Else it returns value + suffix

resolveAlternative(value:Any, length:Int) -> Table

If value is a table, then it will return value. Else it returns a table containing value length times

e.g. resolveAlternative('hi', 2) -> {'hi', 'hi'}

validate(params:Array<Dynamic>, types:Array<String>) -> Bool

Checks if every value of params is their respective types. If one of the params is not their respective type then it prints an error and returns false. Else, returns true

getFlxEaseByString(ease:String) -> String

Returns the FlxEase. If unknown, returns linear

instanceExists(instanceTbl:Table<game.customInstance>, instance:String) -> Bool

Checks if a GhostUtil instance exists.

variableExists(variable:String) -> Bool

Checks if a variable exists in the variables map.

Clone this wiki locally