Bgofix.lua
Revision as of 08:11, 17 November 2016 by Sambo (talk | contribs) (Created page with "Category:LunaLua helper libraries bgofix is an API that makes BGOs more customizable. <b>NOTICE: This page is currently under construction. More complete information can...")
bgofix is an API that makes BGOs more customizable.
NOTICE: This page is currently under construction. More complete information can be found on this page:[1].
Features
With this API, you can:
- Make custom BGOs of any size,
- Change the render priority of BGOs, and
- Give BGOs custom animations
Installation
Download [2] and extract its contents to the LuaScriptsLib directory.
Setup
To enable the bgofix library in a level, add this line to your 'lunadll.lua' file:
local bgofix = API.load ("bgofix");
Use PGE's GIFs2PNG utility to change the contents of your level's folder to PNGs. LunaLua does not support GIF images in its drawImage function.
BGOs of custom sizes will now automatically be rendered correctly at runtime.
Notes:
- If you use a custom image for an animated BGO that is not the same size as the original or change that BGO's render priority, the BGO will not be displayed properly unless you use the setAnimation function.
- Using this library may result in slight changes in the render order of BGOs from normal. If this messes up the render priority, adjust the render priorities with setPriority.
- The BGOs are only rendered correctly during SMBX runtime. In editing mode, they will still be shown in default size. For the most convenience, use the PGE editor as it can draw BGOs of any size natively.
Functions
These functions must be called in onStart in order to work.
| setPriority | id | priority | |
|---|---|---|---|
| Sets the render priority of the BGO | nil | int
The ID of the BGO |
double
The LunaLua render priority. This is not equivalent to the SMBX sort order priority! |