Question regarding background priority #284
-
Hello, I’m doing some quick testing with the library, and I have trouble with the background priorities. I have created two backgrounds with different priorities from the same Tiled0 instance. However, no matter what priority I assign to each one of them, the second background that is created is always displayed on top. What I find strange is that the map inspector from mGBA shows that they have the correct priorities in RAM, they are just not showing in the correct order. Do you know what might cause this ? Here is my code :
Since 0 is higher priority than 1, I’m expecting to see bg to appear on top, but it’s not the case (I tested the other way around, and bg2 always shows up on top, as if the priorities were just ignored). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi! I checked out your repo. The issue here comes down to not specifying a transparent colour in your background toml file. You can specify a colour that you don't use, for instance. So your toml file would read: version = "1.0"
[image.grass]
filename = "tile_sheet.png"
tile_size = "8x8"
transparent_colour = "FF00FF" The reason for this is that agb by default will choose a transparent colour for you, which in this case was your dominant green colour. For this reason when rendering Good luck with your game :) |
Beta Was this translation helpful? Give feedback.
Hi! I checked out your repo.
The issue here comes down to not specifying a transparent colour in your background toml file. You can specify a colour that you don't use, for instance. So your toml file would read:
The reason for this is that agb by default will choose a transparent colour for you, which in this case was your dominant green colour. For this reason when rendering
bg2
every tile was transparent and nothing from that background was rendered. By specifying a transparent colour that you don't use, there will be no transparent colour and every tile will be rendered as you ex…