(shouting)

Using layers, is it possible to make objects on specific layers always render behind others?

Post Reply
User avatar
Nimono
Posts: 745
Joined: 11 years ago

Using layers, is it possible to make objects on specific layers always render behind others?

Post by Nimono »

I know most BGOs always render in the background, but what about the tiles with collision? Is there any way to mark them to always appear above or behind certain other layers, or is it solely dependent on the order you create them in the level?
User avatar
Hoeloe
A2XT person
Posts: 1016
Joined: 12 years ago
Pronouns: she/her
Location: Spaaace

Re: Using layers, is it possible to make objects on specific layers always render behind others?

Post by Hoeloe »

It's actually more dependent on their position in the level, and more importantly, their render priority.

As of SMBX2 MAGLX3, you can use background.txt files to change the render priority of background objects, by setting the priority value.

This link shows you which values various objects are normally rendered at, so you can use it for comparison: https://wohlsoft.ru/pgewiki/LunaLua_Render_Priority

Layers are actually pretty badly named. They're more like tags that let you collectively hide and show, or move, groups of objects. They don't have anything to do with render order.
Image
Image
Image
Image
Image
User avatar
Nimono
Posts: 745
Joined: 11 years ago

Re: Using layers, is it possible to make objects on specific layers always render behind others?

Post by Nimono »

Hoeloe wrote: 4 years ago It's actually more dependent on their position in the level, and more importantly, their render priority.

As of SMBX2 MAGLX3, you can use background.txt files to change the render priority of background objects, by setting the priority value.

This link shows you which values various objects are normally rendered at, so you can use it for comparison: https://wohlsoft.ru/pgewiki/LunaLua_Render_Priority

Layers are actually pretty badly named. They're more like tags that let you collectively hide and show, or move, groups of objects. They don't have anything to do with render order.
Alright, thanks. So essentially, Blocks that are placed closer to the top-left of the level render before blocks that are placed closer to the bottom-right?
User avatar
Emral
Posts: 940
Joined: 10 years ago
https://enjl.talkhaus.com/

Re: Using layers, is it possible to make objects on specific layers always render behind others?

Post by Emral »

Nimono wrote: 4 years ago
Hoeloe wrote: 4 years ago It's actually more dependent on their position in the level, and more importantly, their render priority.

As of SMBX2 MAGLX3, you can use background.txt files to change the render priority of background objects, by setting the priority value.

This link shows you which values various objects are normally rendered at, so you can use it for comparison: https://wohlsoft.ru/pgewiki/LunaLua_Render_Priority

Layers are actually pretty badly named. They're more like tags that let you collectively hide and show, or move, groups of objects. They don't have anything to do with render order.
Alright, thanks. So essentially, Blocks that are placed closer to the top-left of the level render before blocks that are placed closer to the bottom-right?
Yes, but there are some exceptions you can use to cheat the system to your advantage:
-Sizeable blocks will render behind all other blocks and even behind most BGOs. Only the furthest back BGOs (whose priority can be adjusted now) such as water will be behind sizeables.
-Lava renders in front of other blocks, as well as the player and all NPCs.
-You can use invisible blocks and textured BGOs to essentially get blocks to look like they rendered at whatever priority you desire.
I do things. You can find them on my talkhaus site. https://enjl.talkhaus.com/
Here is another link. This one lets you draw.
https://enjl.talkhaus.com/draw.html
User avatar
Nimono
Posts: 745
Joined: 11 years ago

Re: Using layers, is it possible to make objects on specific layers always render behind others?

Post by Nimono »

Enjl wrote: 4 years ago Yes, but there are some exceptions you can use to cheat the system to your advantage:
-Sizeable blocks will render behind all other blocks and even behind most BGOs. Only the furthest back BGOs (whose priority can be adjusted now) such as water will be behind sizeables.
-Lava renders in front of other blocks, as well as the player and all NPCs.
-You can use invisible blocks and textured BGOs to essentially get blocks to look like they rendered at whatever priority you desire.
Oooh, yeah, I forgot about invis blocks! The only issue I have left with it is that BGOs still render behind normal blocks, which is unfortunate- I basically need a block to render behind a block, and then a BGO to render in front of these blocks, BUT no other blocks. For some reason, it's not working out that way- even position changes aren't making the later blocks render above the foreground BGOs set to just -65 priority... Am I doing something wrong?
User avatar
Emral
Posts: 940
Joined: 10 years ago
https://enjl.talkhaus.com/

Re: Using layers, is it possible to make objects on specific layers always render behind others?

Post by Emral »

Nimono wrote: 4 years ago
Enjl wrote: 4 years ago Yes, but there are some exceptions you can use to cheat the system to your advantage:
-Sizeable blocks will render behind all other blocks and even behind most BGOs. Only the furthest back BGOs (whose priority can be adjusted now) such as water will be behind sizeables.
-Lava renders in front of other blocks, as well as the player and all NPCs.
-You can use invisible blocks and textured BGOs to essentially get blocks to look like they rendered at whatever priority you desire.
Oooh, yeah, I forgot about invis blocks! The only issue I have left with it is that BGOs still render behind normal blocks, which is unfortunate- I basically need a block to render behind a block, and then a BGO to render in front of these blocks, BUT no other blocks. For some reason, it's not working out that way- even position changes aren't making the later blocks render above the foreground BGOs set to just -65 priority... Am I doing something wrong?
BGOs are collectively drawn after blocks are drawn... so what I would do is have some invisiblocks with bgos drawn to like -67, bgos drawn to -66 and regular blocks on -65 as usual, if I understand what you're getting at correctly.
I do things. You can find them on my talkhaus site. https://enjl.talkhaus.com/
Here is another link. This one lets you draw.
https://enjl.talkhaus.com/draw.html
User avatar
Nimono
Posts: 745
Joined: 11 years ago

Re: Using layers, is it possible to make objects on specific layers always render behind others?

Post by Nimono »

Enjl wrote: 4 years ago BGOs are collectively drawn after blocks are drawn... so what I would do is have some invisiblocks with bgos drawn to like -67, bgos drawn to -66 and regular blocks on -65 as usual, if I understand what you're getting at correctly.
...Ahhh, I think I get what you're saying now. Thank you!
Post Reply