LunaLua Render Priority

From PGE Wiki
Jump to navigation Jump to search

The LunaLua render priority (also known as z-index or z-value) is controlled by a double value.
Renderable objects with lower render priority values are render first and those with higher values are rendered last.
In LunaLua you can specifiy render values with Text.printWP, Graphics.drawImageWP, Graphics.drawImageToSceneWP, Graphics.glDraw. The current valid range of render values is between -100 and 10.

Default Render Values

Here you can see a list of all default render values.

LunaLua Render Values

This is a list of render values built-in into LunaLua.

Value Name Description
-100.0 SMBX Level Background The Level Background
-95.0 SMBX BGO SMBX BGOs which are rendered on the furtherst back of the scene.
-90.0 SMBX Sizeable Blocks All SMBX sizeable blocks
-85.0 SMBX BGO SMBX BGOs which are rendered on the back.
-80.0 SMBX Special BGO (i.e. locks) All special BGOs like locks.
-75.0 SMBX Background NPCs SMBX background NPCs like vines, piranah plants, diggable sand, mother brain, things in MB jars.
-70.0 SMBX Held NPCs SMBX NPCs which are held by the player.
-65.0 SMBX Normal Blocks All normal SMBX blocks.
-60.0 SMBX Effects Some effects, which are on the background: doors, pressed p-switches, some other stuff
-55.0 SMBX NPC Some SMBX NPCs like: coins, clown car, chompy, herb, wood rocket, koopaling fire
-50.0 SMBX NPC Some SMBX NPCs like ice blocks.
-45.0 SMBX NPC All common SMBX NPCs.
-40.0 SMBX Chat Icon The SMBX chat icon, which is displayed, when you can talk with an NPC.
-35.0 SMBX Player Mounts The player mounts: Yoshi, Clowncar, Shoe
-30.0 SMBX Player Mounts? Maybe is the same as -35.0
-25.0 SMBX Players All active players on screen.
-20.0 SMBX BGO All foreground BGOs.
-15.0 SMBX NPC All foreground NPCs.
-10.0 SMBX Block All foreground Blocks.
-5.0 SMBX Effect All foreground Effects.
1.0 Image Draw Render commands like Graphics.drawImage.
2.0 Placed Sprites Placed sprite by Autocode or LunaLua's Graphics.placeSprite.
3.0 Text Draw Text which is drawn by Autocode or LunaLua's Text.print.
5.0 SMBX HUD All elements of the SMBX HUD.

API Render Values

If an API-Developer or HUD-Developer uses special render values, then he can write them here:

Value Name Description