HorikawaTools.lua
| This is the archived page of the old LunaLua documentation The rest of LunaLua related articles in this wiki contain a lot of outdated documentation preserved for historical purposes and may be used with legacy versions of the LunaLua.
Please visit the SMBX2 Documentation Page to access the latest documentation for the LunaLua scripting system of the SMBX2 Project. Adding LunaLua contents into this Wiki is not advised. |
HorikawaTools is a library providing various useful functions.
Download: http://hastebin.com/ponesulepe.lua
Installation
Place the file horikawaTools.lua into the LuaScriptsLib folder.
How to use
To enable the HorikawaTools library for a specific level, add this line to lunadll.lua:
local horikawaTools = API.load("horikawaTools");
This will load the HorikawaTools API.
Functions
| tableConcat | table 1 | table 2 | |||
|---|---|---|---|---|---|
| Merges two tables into one. | table | table
The base table. |
table
The table to be added to the end of the table 1. | ||
| loadLevel | filename | loading episode name | warp index | ||
| Exits the current level and loads a new one. | nil | string | string | int | |
| coordinatesToPixels | x | y | |||
| Returns the x and y-values relating to the coordinates given in terms of pixels. | int, int | int | int | ||
| makeBlockInvisible | block | ||||
| Makes a block invisible. | nil | Block | |||
| freezePlayer | pause music | pause sound | player x | player y | |
| Freezes the player in one spot. | nil | boolean
Whether or not the music should be stopped while the player is frozen. (Default: false) |
boolean
Whether or not any sounds should be stopped while the player is frozen. (Default: false) |
int
X-position (in the scene) where the player is frozen. (Default: current player x) |
int
Y-position (in the scene) where the player is frozen. (Default: current player y) |
| unfreezePlayer | music paused | sound paused | |||
| Unfreezes the player from one spot. | nil | boolean
Whether or not any music has been paused while the player was frozen. (Default: false) |
boolean
Whether or not any sounds have been paused while the player was frozen. (Default: false) | ||
| makePlayerInvisible | player | ||||
| Makes the player invisible. | nil | Player | |||
| printCenterX | text | y | |||
| Prints a string of text centered on the screen in the x-axis at the specified y-coordinate. | nil | string | int | ||
| makeNPCInvisible | NPC | ||||
| Makes an NPC invisible. | nil | npc |
Not all features are documented yet on this page, however the file itself is well commented when needed.