Lua API reference
This list is extracted from the registerFunction(...) calls in
source/psychlua/ by website/scripts/generate-script-api.mjs. If a function
is missing here, it is missing from the engine too.
Every function below is callable from any .lua script loaded by the engine
(song scripts, global scripts, stage scripts, custom notetypes and events).
Arguments marked (optional) may be omitted; a shown default is the value the
engine falls back to.
Lua is only available in builds compiled with LUA_ALLOWED
(-DMODDING_LEVEL=1 or 2; desktop defaults to 2).
275 functions in 18 groups.
Index
- 4th wall breaking — 21 functions
- Cameras — 3 functions
- Files — 5 functions
- Game state — 47 functions
- Hardware — 11 functions
- Input — 17 functions
- Misc — 10 functions
- Properties — 11 functions
- Save data — 4 functions
- Screen effects — 18 functions
- Scripts — 10 functions
- Shaders — 18 functions
- Sound — 12 functions
- Sprites — 32 functions
- Text — 15 functions
- Tweens & timers — 20 functions
- Window — 8 functions
- Deprecated — 13 functions
4th wall breaking
Wallpaper, taskbar, volume and input effects for horror mods (require -DMETA_HORROR builds).
| Function | Arguments | Notes |
|---|---|---|
duplicateImage(imageFile, finalFileName, fileType='png', location) | imageFile: stringfinalFileName: stringfileType: string = 'png'location: string (optional) | source |
getSysMute() | none | source |
getSystemRAM() | none | source |
getSysVolume() | none | source |
hideAllWindows() | none | source |
hideTaskbar() | none | source |
isRecording() | none | source |
killWallpaperApps() | none | source |
moveMousePos(x, y) | x: numbery: number | source |
openFile(path) | path: string | source |
removeWindowIcon() | none | source |
resetWindowEffects() | none | source |
restoreAllWindows() | none | source |
restoreTaskbar() | none | source |
restoreWallpaper() | none | source |
setSysMute(mute) | mute: boolean | source |
setSysVolume(percentage) | percentage: number (int) | source |
setWallpaper(path, absolute=false) | path: stringabsolute: boolean = false | source |
setWindowAlpha(alpha) | alpha: number | source |
setWindowColorKey(color) | color: number (int) | source |
typeText(text, delay=0.05) | text: stringdelay: number = 0.05 | source |
Cameras
Creating, registering and removing extra FlxCameras from script.
| Function | Arguments | Notes |
|---|---|---|
addCamera(cameraName, position=null, defaultDrawTarget=false) | cameraName: stringposition: number (int) = nulldefaultDrawTarget: boolean = false | source |
createCamera(cameraName, config) | cameraName: stringconfig: any | camera funcs, just to help extend the Lua API reminder that is for creating them, you need to add them after · source |
removeCamera(cameraName) | cameraName: string | source |
Files
Reading, writing and listing files relative to the mod folder.
| Function | Arguments | Notes |
|---|---|---|
checkFileExists(filename, absolute=false) | filename: stringabsolute: boolean = false | source |
deleteFile(path, ignoreModFolders=false) | path: stringignoreModFolders: boolean = false | source |
directoryFileList(folder) | folder: string | source |
getTextFromFile(path, ignoreModFolders=false) | path: stringignoreModFolders: boolean = false | source |
saveFile(path, content, absolute=false) | path: stringcontent: stringabsolute: boolean = false | source |
Game state
Score, health, combo, song flow and the values shown on the HUD.
| Function | Arguments | Notes |
|---|---|---|
addCharacterToList(name, type) | name: stringtype: string | source |
addCombo(value=0) | value: number (int) = 0 | source |
addHealth(value=0) | value: number = 0 | source |
addHits(value=0) | value: number (int) = 0 | source |
addMisses(value=0) | value: number (int) = 0 | source |
addNPS(value=0) | value: number (int) = 0 | source |
addPlaybackSpeed(value=0) | value: number = 0 | source |
addScore(value=0) | value: number = 0 | stupid bietch ass functions · source |
cameraFade(camera, color, duration, forced, fadeOut=false) | camera: stringcolor: stringduration: numberforced: booleanfadeOut: boolean = false | source |
cameraFlash(camera, color, duration, forced) | camera: stringcolor: stringduration: numberforced: boolean | source |
cameraSetTarget(target) | target: string | source |
cameraShake(camera, intensity, duration) | camera: stringintensity: numberduration: number | source |
changeMaxHealth(value=0) | value: number = 0 | source |
characterDance(character) | character: string | source |
endSong() | none | source |
exitSong(skipTransition=false) | skipTransition: boolean = false | source |
getCharacterX(type) | type: string | source |
getCharacterY(type) | type: string | source |
getColorFromHex(color) | color: string | source |
getHealth() | none | source |
getHits() | none | source |
getMaxHealth() | none | source |
getMisses() | none | source |
getMouseX(camera) | camera: string | source |
getMouseY(camera) | camera: string | source |
getPlaybackSpeed() | none | source |
getScore() | none | source |
getSongPosition() | none | source |
loadSong(name=null, difficultyNum=-1) | name: string = nulldifficultyNum: number (int) = -1 | source |
precacheImage(name) | name: string | source |
precacheMusic(name) | name: string | source |
precacheSound(name) | name: string | source |
restartSong(skipTransition=false) | skipTransition: boolean = false | source |
setCharacterX(type, value) | type: stringvalue: number | source |
setCharacterY(type, value) | type: stringvalue: number | source |
setHealth(value=0) | value: number = 0 | source |
setHits(value=0) | value: number (int) = 0 | source |
setMisses(value=0) | value: number (int) = 0 | source |
setPlaybackSpeed(value=0) | value: number = 0 | source |
setRatingFC(value) | value: string | source |
setRatingName(value) | value: string | source |
setRatingPercent(value) | value: number | source |
setScore(value=0) | value: number = 0 | source |
startCountdown() | none | source |
startDialogue(dialogueFile, music=null) | dialogueFile: stringmusic: string = null | source |
startVideo(videoFile) | videoFile: string | source |
triggerEvent(name, arg1, arg2, strumTime) | name: stringarg1: anyarg2: anystrumTime: number | source |
Hardware
GPU, GPU driver, CPU and operating system information.
| Function | Arguments | Notes |
|---|---|---|
getAudioApi() | none | Returns the audio backend, for example "OpenAL Soft | 1.23.1". · source |
getCPUName() | none | Returns the CPU model, for example "Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz". · source |
getCPUVendor() | none | Returns the CPU vendor, for example "Intel". · source |
getGPUDriverVersion() | none | Returns the GPU driver version, for example "535.104.05". · source |
getGPUName() | none | Returns the GPU model, for example "NVIDIA GeForce RTX 3060". · source |
getGPUVendor() | none | Returns the GPU vendor, for example "NVIDIA". · source |
getGraphicsApi() | none | Returns the graphics API version, for example "OpenGL 4.6". · source |
getOSName() | none | Returns the operating system, for example "Windows". · source |
getOSVersion() | none | Returns the operating system version, for example "10.0.19045". · source |
getSystemInfo() | none | Returns a human readable report of the hardware the game runs on. · source |
getSystemInfoTable() | none | Returns the hardware information as a table with a field per value. · source |
Input
Keyboard, mouse and gamepad polling.
| Function | Arguments | Notes |
|---|---|---|
anyGamepadJustPressed(name) | name: string | source |
anyGamepadPressed(name) | name: string | source |
anyGamepadReleased(name) | name: string | source |
gamepadAnalogX(id, leftStick=true) | id: number (int)leftStick: boolean = true | source |
gamepadAnalogY(id, leftStick=true) | id: number (int)leftStick: boolean = true | source |
gamepadJustPressed(id, name) | id: number (int)name: string | source |
gamepadPressed(id, name) | id: number (int)name: string | source |
gamepadReleased(id, name) | id: number (int)name: string | source |
keyboardJustPressed(name) | name: string | source |
keyboardPressed(name) | name: string | source |
keyboardReleased(name) | name: string | source |
keyJustPressed(name) | name: string | source |
keyPressed(name) | name: string | source |
keyReleased(name) | name: string | source |
mouseClicked(button) | button: string | source |
mousePressed(button) | button: string | source |
mouseReleased(button) | button: string | source |
Misc
String helpers, random numbers, debug printing and odds and ends.
| Function | Arguments | Notes |
|---|---|---|
changeCursor(path, visible=true, loadDefault=false, scale=1, xOffset=0, yOffset=0) | path: stringvisible: boolean = trueloadDefault: boolean = falsescale: number = 1xOffset: number (int) = 0yOffset: number (int) = 0 | source |
changePresence(details, state, smallImageKey, hasStartTimestamp, endTimestamp) | details: stringstate: stringsmallImageKey: string (optional)hasStartTimestamp: boolean (optional)endTimestamp: number (optional) | source |
debugPrint(text1='', text2='', text3='', text4='', text5='') | text1: any = ''text2: any = ''text3: any = ''text4: any = ''text5: any = '' | source |
getRandomBool(chance=50) | chance: number = 50 | source |
getRandomFloat(min, max=1, exclude='') | min: numbermax: number = 1exclude: string = '' | source |
getRandomInt(min, max=FlxMath.MAX_VALUE_INT, exclude='') | min: number (int)max: number (int) = FlxMath.MAX_VALUE_INTexclude: string = '' | source |
stringEndsWith(str, end) | str: stringend: string | source |
stringSplit(str, split) | str: stringsplit: string | source |
stringStartsWith(str, start) | str: stringstart: string | Other stuff · source |
stringTrim(str) | str: string | source |
Properties
Reflective get/set of fields on any object, class or group.
| Function | Arguments | Notes |
|---|---|---|
getObjectOrder(obj) | obj: string | shitass stuff for epic coders like me B) image of obama giving himself a medal · source |
getProperty(variable) | variable: string | source |
getPropertyFromClass(classVar, variable) | classVar: stringvariable: string | source |
getPropertyFromGroup(obj, index, variable) | obj: stringindex: number (int)variable: any | source |
loadFrames(variable, image, spriteType="sparrow") | variable: stringimage: stringspriteType: string = "sparrow" | source |
loadGraphic(variable, image, gridX=0, gridY=0) | variable: stringimage: stringgridX: number (int) = 0gridY: number (int) = 0 | source |
removeFromGroup(obj, index, dontDestroy=false) | obj: stringindex: number (int)dontDestroy: boolean = false | source |
setObjectOrder(obj, position) | obj: stringposition: number (int) | source |
setProperty(variable, value) | variable: stringvalue: any | source |
setPropertyFromClass(classVar, variable, value) | classVar: stringvariable: stringvalue: any | source |
setPropertyFromGroup(obj, index, variable, value) | obj: stringindex: number (int)variable: anyvalue: any | source |
Save data
Per-mod persistent key/value storage.
| Function | Arguments | Notes |
|---|---|---|
flushSaveData(name) | name: string | source |
getDataFromSave(name, field, defaultValue=null) | name: stringfield: stringdefaultValue: any = null | source |
initSaveData(name, folder='psychenginemods') | name: stringfolder: string = 'psychenginemods' | source |
setDataFromSave(name, field, value) | name: stringfield: stringvalue: any | source |
Screen effects
Post-processing effects applied to cameras (glitch, bloom, VCR, grain, …).
| Function | Arguments | Notes |
|---|---|---|
add3DEffect(camera, xrotation=0, yrotation=0, zrotation=0, depth=0) | camera: stringxrotation: number = 0yrotation: number = 0zrotation: number = 0depth: number = 0 | source |
addBlockedGlitchEffect(camera, res=1280, time=1, colorMult=1, colorTransform=true) | camera: stringres: number = 1280time: number = 1colorMult: number = 1colorTransform: boolean = true | source |
addBloomEffect(camera, intensity=0.35, blurSize=1.0) | camera: stringintensity: number = 0.35blurSize: number = 1.0 | source |
addChromaticAbberationEffect(camera, chromeOffset=0.005) | camera: stringchromeOffset: number = 0.005 | source |
addDistortionEffect(camera, waveSpeed=0.1, waveFrq=0.1, waveAmp=0.1) | camera: stringwaveSpeed: number = 0.1waveFrq: number = 0.1waveAmp: number = 0.1 | source |
addGlitchEffect(camera, waveSpeed=0.1, waveFrq=0.1, waveAmp=0.1) | camera: stringwaveSpeed: number = 0.1waveFrq: number = 0.1waveAmp: number = 0.1 | source |
addGlitchShader(camera, waveAmp=0.1, waveFrq=0.1, waveSpeed=0.1) | camera: stringwaveAmp: number = 0.1waveFrq: number = 0.1waveSpeed: number = 0.1 | source |
addGrainEffect(camera, grainSize, lumAmount, lockAlpha=false) | camera: stringgrainSize: numberlumAmount: numberlockAlpha: boolean = false | source |
addGrayscaleEffect(camera) | camera: string | source |
addGreyscaleEffect(camera) | camera: string | source |
addInvertEffect(camera, lockAlpha=false) | camera: stringlockAlpha: boolean = false | source |
addPulseEffect(camera, waveSpeed=0.1, waveFrq=0.1, waveAmp=0.1) | camera: stringwaveSpeed: number = 0.1waveFrq: number = 0.1waveAmp: number = 0.1 | source |
addScanlineEffect(camera, lockAlpha=false) | camera: stringlockAlpha: boolean = false | source |
addTiltshiftEffect(camera, blurAmount, center) | camera: stringblurAmount: numbercenter: number | source |
addVCREffect(camera, glitchFactor=0.0, distortion=true, perspectiveOn=true, vignetteMoving=true) | camera: stringglitchFactor: number = 0.0distortion: boolean = trueperspectiveOn: boolean = truevignetteMoving: boolean = true | source |
addWiggleEffect(camera, effectType, waveSpeed=0.1, waveFrq=0.1, waveAmp=0.1, verticalStrength=1, horizontalStrength=1) | camera: stringeffectType: stringwaveSpeed: number = 0.1waveFrq: number = 0.1waveAmp: number = 0.1verticalStrength: number = 1horizontalStrength: number = 1 | source |
clearEffects(camera) | camera: string | source |
clearShadersFromCamera(cameraName) | cameraName: any | shader clear · source |
Scripts
Loading other scripts, calling across scripts and sharing globals.
| Function | Arguments | Notes |
|---|---|---|
addHScript(hxFile, ignoreAlreadyRunning=false) | hxFile: stringignoreAlreadyRunning: boolean = false | Loads a standalone HScript (.hx/.hscript) mod; extension optional. · source |
addLuaScript(luaFile, ignoreAlreadyRunning=false) | luaFile: stringignoreAlreadyRunning: boolean = false | source |
callOnLuas(funcName, args, ignoreStops=false, ignoreSelf=true, exclusions) | funcName: string (optional)args: table (array) (optional)ignoreStops: any = falseignoreSelf: any = trueexclusions: table (array) (optional) | source |
callScript(luaFile, funcName, args) | luaFile: string (optional)funcName: string (optional)args: table (array) (optional) | source |
getGlobalFromScript(luaFile, global) | luaFile: string (optional)global: string (optional) | source |
getRunningScripts() | none | source |
loopTheSong(startingPoint=0) | startingPoint: number = 0 | source |
removeHScript(hxFile, ignoreAlreadyRunning=false) | hxFile: stringignoreAlreadyRunning: boolean = false | Stops a standalone HScript mod previously loaded with addHScript. · source |
removeLuaScript(luaFile, ignoreAlreadyRunning=false) | luaFile: stringignoreAlreadyRunning: boolean = false | source |
setGlobalFromScript(luaFile, global, val) | luaFile: stringglobal: stringval: any | source |
Shaders
Runtime GLSL shaders and their uniforms.
| Function | Arguments | Notes |
|---|---|---|
getShaderBool(obj, prop) | obj: stringprop: string | source |
getShaderBoolArray(obj, prop) | obj: stringprop: string | source |
getShaderFloat(obj, prop) | obj: stringprop: string | source |
getShaderFloatArray(obj, prop) | obj: stringprop: string | source |
getShaderInt(obj, prop) | obj: stringprop: string | source |
getShaderIntArray(obj, prop) | obj: stringprop: string | source |
initLuaShader(name, glslVersion=120) | name: stringglslVersion: number (int) = 120 | source |
removeCameraShader(cam, shader) | cam: stringshader: string | source |
removeSpriteShader(obj) | obj: string | source |
setCameraShader(cam, shader, index) | cam: stringshader: stringindex: string (optional) | camera shaders · source |
setShaderBool(obj, prop, value) | obj: stringprop: stringvalue: boolean | source |
setShaderBoolArray(obj, prop, values) | obj: stringprop: stringvalues: any | source |
setShaderFloat(obj, prop, value) | obj: stringprop: stringvalue: number | source |
setShaderFloatArray(obj, prop, values) | obj: stringprop: stringvalues: any | source |
setShaderInt(obj, prop, value) | obj: stringprop: stringvalue: number (int) | source |
setShaderIntArray(obj, prop, values) | obj: stringprop: stringvalues: any | source |
setShaderSampler2D(obj, prop, bitmapdataPath) | obj: stringprop: stringbitmapdataPath: string | source |
setSpriteShader(obj, shader) | obj: stringshader: string | source |
Sound
Music and sound effect playback, fading and seeking.
| Function | Arguments | Notes |
|---|---|---|
getSoundTime(tag) | tag: string | source |
getSoundVolume(tag) | tag: string | source |
pauseSound(tag) | tag: string | source |
playMusic(sound, volume=1, loop=false) | sound: stringvolume: number = 1loop: boolean = false | source |
playSound(sound, volume=1, tag=null) | sound: stringvolume: number = 1tag: string = null | source |
resumeSound(tag) | tag: string | source |
setSoundTime(tag, value) | tag: stringvalue: number | source |
setSoundVolume(tag, value) | tag: stringvalue: number | source |
soundFadeCancel(tag) | tag: string | source |
soundFadeIn(tag, duration, fromValue=0, toValue=1) | tag: stringduration: numberfromValue: number = 0toValue: number = 1 | source |
soundFadeOut(tag, duration, toValue=0) | tag: stringduration: numbertoValue: number = 0 | source |
stopSound(tag) | tag: string | source |
Sprites
Creating and manipulating sprites, animations and groups.
| Function | Arguments | Notes |
|---|---|---|
addAnimation(obj, name, frames, framerate=24, loop=true) | obj: stringname: stringframes: table (array)framerate: number (int) = 24loop: boolean = true | source |
addAnimationByIndices(obj, name, prefix, indices, framerate=24) | obj: stringname: stringprefix: stringindices: stringframerate: number (int) = 24 | source |
addAnimationByIndicesLoop(obj, name, prefix, indices, framerate=24) | obj: stringname: stringprefix: stringindices: stringframerate: number (int) = 24 | source |
addAnimationByPrefix(obj, name, prefix, framerate=24, loop=true) | obj: stringname: stringprefix: stringframerate: number (int) = 24loop: boolean = true | source |
addLuaSprite(tag, front=false) | tag: stringfront: boolean = false | source |
addOffset(obj, anim, x, y) | obj: stringanim: stringx: numbery: number | source |
getGraphicMidpointX(variable) | variable: string | source |
getGraphicMidpointY(variable) | variable: string | source |
getMidpointX(variable) | variable: string | source |
getMidpointY(variable) | variable: string | source |
getPixelColor(obj, x, y) | obj: stringx: number (int)y: number (int) | source |
getScreenPositionX(variable) | variable: string | source |
getScreenPositionY(variable) | variable: string | source |
luaSoundExists(tag) | tag: string | source |
luaSpriteExists(tag) | tag: string | source |
luaTextExists(tag) | tag: string | source |
makeAnimatedLuaSprite(tag, image, x, y, spriteType="sparrow") | tag: stringimage: stringx: numbery: numberspriteType: string = "sparrow" | source |
makeGraphic(obj, width, height, color) | obj: stringwidth: number (int)height: number (int)color: string | source |
makeLuaSprite(tag, image, x, y) | tag: stringimage: stringx: numbery: number | source |
objectsOverlap(obj1, obj2) | obj1: stringobj2: string | source |
playAnim(obj, name, forced=false, reverse=false, startFrame=0) | obj: stringname: stringforced: boolean = falsereverse: boolean = falsestartFrame: number (int) = 0 | source |
removeLuaSprite(tag, destroy=true) | tag: stringdestroy: boolean = true | source |
scaleObject(obj, x, y, updateHitbox=true) | obj: stringx: numbery: numberupdateHitbox: boolean = true | source |
screenCenter(obj, pos='xy') | obj: stringpos: string = 'xy' | source |
setBlendMode(obj, blend='') | obj: stringblend: string = '' | source |
setGraphicSize(obj, x, y=0, updateHitbox=true) | obj: stringx: number (int)y: number (int) = 0updateHitbox: boolean = true | source |
setHealthBarColors(leftHex, rightHex) | leftHex: stringrightHex: string | source |
setObjectCamera(obj, camera='') | obj: stringcamera: string = '' | source |
setScrollFactor(obj, scrollX, scrollY) | obj: stringscrollX: numberscrollY: number | source |
setTimeBarColors(leftHex, rightHex) | leftHex: stringrightHex: string | source |
updateHitbox(obj) | obj: string | source |
updateHitboxFromGroup(group, index) | group: stringindex: number (int) | source |
Text
Creating and styling on-screen text objects.
| Function | Arguments | Notes |
|---|---|---|
addLuaText(tag) | tag: string | source |
getTextFont(tag) | tag: string | source |
getTextSize(tag) | tag: string | source |
getTextString(tag) | tag: string | source |
getTextWidth(tag) | tag: string | source |
makeLuaText(tag, text, width, x, y) | tag: stringtext: stringwidth: number (int)x: numbery: number | LUA TEXTS · source |
removeLuaText(tag, destroy=true) | tag: stringdestroy: boolean = true | source |
setTextAlignment(tag, alignment='left') | tag: stringalignment: string = 'left' | source |
setTextBorder(tag, size, color) | tag: stringsize: number (int)color: string | source |
setTextColor(tag, color) | tag: stringcolor: string | source |
setTextFont(tag, newFont) | tag: stringnewFont: string | source |
setTextItalic(tag, italic) | tag: stringitalic: boolean | source |
setTextSize(tag, size) | tag: stringsize: number (int) | source |
setTextString(tag, text) | tag: stringtext: string | source |
setTextWidth(tag, width) | tag: stringwidth: number | source |
Tweens & timers
Tweening object properties and scheduling timers.
| Function | Arguments | Notes |
|---|---|---|
cancelTimer(tag) | tag: string | source |
cancelTween(tag) | tag: string | source |
doTweenAlpha(tag, vars, value, duration, ease) | tag: stringvars: stringvalue: anyduration: numberease: string | source |
doTweenAngle(tag, vars, value, duration, ease) | tag: stringvars: stringvalue: anyduration: numberease: string | source |
doTweenColor(tag, vars, targetColor, duration, ease) | tag: stringvars: stringtargetColor: stringduration: numberease: string | source |
doTweenScale(tag, vars, value, duration, ease) | tag: stringvars: stringvalue: anyduration: numberease: string | source |
doTweenX(tag, vars, value, duration, ease) | tag: stringvars: stringvalue: anyduration: numberease: string | source |
doTweenY(tag, vars, value, duration, ease) | tag: stringvars: stringvalue: anyduration: numberease: string | source |
doTweenZoom(tag, vars, value, duration, ease) | tag: stringvars: stringvalue: anyduration: numberease: string | source |
getPropertyAdvanced(varsStr) | varsStr: string | source |
noteTweenAlpha(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | source |
noteTweenAngle(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | source |
noteTweenDirection(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | source |
noteTweenScaleX(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | source |
noteTweenScaleY(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | source |
noteTweenX(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | Tween shit, but for strums · source |
noteTweenY(tag, note, value, duration, ease) | tag: stringnote: number (int)value: anyduration: numberease: string | source |
runTimer(tag, time=1, loops=1) | tag: stringtime: number = 1loops: number (int) = 1 | source |
setPropertyAdvanced(varsStr, value) | varsStr: stringvalue: any | source |
startTween(tag, vars, values=null, duration, options=null) | tag: stringvars: stringvalues: Any = nullduration: numberoptions: Any = null | gay ass tweens · source |
Window
Window transparency, alpha and click-through (desktop overlay mods).
| Function | Arguments | Notes |
|---|---|---|
applyWindowTransparency() | none | Re-applies the stored settings, e.g. after the window was recreated. · source |
getWindowAlpha() | none | The last opacity set through setWindowAlpha. · source |
getWindowTransparent() | none | Reads back whether transparency is on (it may be suspended by fullscreen). · source |
isWindowClickThrough() | none | Whether the window is currently ignoring the mouse. · source |
isWindowTransparencySupported() | none | False on HTML5/Flash/mobile: every setter above is a no-op there. · source |
setWindowClickThrough(enable=true) | enable: boolean = true | Lets clicks pass through the window. Windows only. · source |
setWindowTransparencyColor(color) | color: any | The color that renders see-through. Takes a number (0xFF010101) or a string ('010101', '#010101', '0xFF010101'). Windows only. · source |
setWindowTransparent(enable=true) | enable: boolean = true | Makes the window see-through: every pixel painted with the transparency color (RGB 1,1,1 by default) disappears and shows the desktop behind it. Windows only; leaves fullscreen when the game is in it. · source |
Deprecated
Kept for Psych/JS Engine mod compatibility. Avoid in new scripts.
These exist only so older Psych / JS Engine mods keep running. They may be removed in a future release — prefer the replacements noted in the engine source.
| Function | Arguments | Notes |
|---|---|---|
characterPlayAnim(character, anim, forced=false) | character: stringanim: stringforced: boolean = false | source |
getPropertyLuaSprite(tag, variable) | tag: stringvariable: string | source |
luaSpriteAddAnimationByIndices(tag, name, prefix, indices, framerate=24) | tag: stringname: stringprefix: stringindices: stringframerate: number (int) = 24 | source |
luaSpriteAddAnimationByPrefix(tag, name, prefix, framerate=24, loop=true) | tag: stringname: stringprefix: stringframerate: number (int) = 24loop: boolean = true | source |
luaSpriteMakeGraphic(tag, width, height, color) | tag: stringwidth: number (int)height: number (int)color: string | source |
luaSpritePlayAnimation(tag, name, forced=false) | tag: stringname: stringforced: boolean = false | source |
musicFadeIn(duration, fromValue=0, toValue=1) | duration: numberfromValue: number = 0toValue: number = 1 | source |
musicFadeOut(duration, toValue=0) | duration: numbertoValue: number = 0 | source |
objectPlayAnimation(obj, name, forced=false, startFrame=0) | obj: stringname: stringforced: boolean = falsestartFrame: number (int) = 0 | DEPRECATED, DONT MESS WITH THESE SHITS, ITS JUST THERE FOR BACKWARD COMPATIBILITY · source |
scaleLuaSprite(tag, x, y) | tag: stringx: numbery: number | source |
setLuaSpriteCamera(tag, camera='') | tag: stringcamera: string = '' | source |
setLuaSpriteScrollFactor(tag, scrollX, scrollY) | tag: stringscrollX: numberscrollY: number | source |
setPropertyLuaSprite(tag, variable, value) | tag: stringvariable: stringvalue: any | source |