Psych Engine Logo
Psych Engine - Lua Script API

Uncategorized Functions

Functions without a category made strictly for them.


FlxColor

FlxColor(color:String):Int

Turns a color string/hexadecimal into an Integer value usable in "setProperty" and other functions.

Examples:


getColorFromName

getColorFromName(color:String):Int

Identical function and usage to FlxColor.


getColorFromString

getColorFromString(color:String):Int

Identical function and usage to FlxColor.


getColorFromHex

getColorFromHex(color:String):Int

Turns a color hexadecimal into an Integer value usable in "setProperty" and other functions.
This differs from FlxColor because it doesn't accept color names and doesn't require a "#" before the value.

Examples:


stringStartsWith

stringStartsWith(str:String, start:String):Bool

Shortcut for StringTools.startsWith in Lua.

Examples:


stringEndsWith

stringEndsWith(str:String, end:String):Bool

Shortcut for StringTools.endsWith in Lua.

Examples:


stringSplit

stringSplit(str:String, split:String):Array<String>

Shortcut for String.split in Lua.

Examples:


stringTrim

stringTrim(str:String):String

Clears the spaces at the start and end of a string.
Shortcut for StringTools.trim in Lua.

Examples:


getRandomBool

getRandomBool(?chance:Float = 50):Bool

Randomizer that returns either "true" or "false".

Examples:


getRandomInt

getRandomInt(min:Int, ?max:Int = FlxMath.MAX_VALUE_INT, ?exclude:String = ''):Int

Randomizer that returns an integer value.

Examples:


getRandomFloat

getRandomFloat(min:Float, ?max:Float = 1, ?exclude:String = ''):Float

Randomizer that returns a float value.

Examples:


debugPrint

debugPrint(text:Dynamic, ?color:String = 'WHITE'):Void

Shows a colorable text at the top left corner of the screen that fades out after 5 seconds, used for quick debugging purposes.

Examples:


getModSetting

getModSetting(saveTag:String, ?modName:String = null):Dynamic

Returns the value saved for a Mod Setting from a properly configured "settings.json".

Examples: