PlayerGfx.lua

Download latest version Download example level

playerGfx is a library for swapping or overlaying sets of player graphics at runtime.

Note: If you have SMBX2, this library is unnessary for use due to costume system.

Installation
Drop the playerGfx.lua file in the LuaScriptsLib folder.

How to use
Overlay/replacement images should be formatted like regular SMBX player graphics, except they must be PNG files with transparent backgrounds and they should ideally use the naming convention "[prefix]_[number]" as opposed to SMBX's default "[prefix]-number". They should be placed in the episode or level folder.

Once you have your images in place, load in the API and use 'playerGfx.arrayFromPrefix' to generate a table of your images' filenames. Use that table in PlayerGfxSet.createEx to generate a PlayerGraphicsSet instance, and call playerGfx.assignSet to assign a PlayerGraphicsSet to a given character.

Player graphic sets are only used when playerGfx.isOn == true; use playerGfx.enable, playerGfx.disable and playerGfx.toggle to activate and deactivate the system.