2D Toolkit Forum
2D Toolkit => Support => Topic started by: Neeko on March 09, 2014, 03:31:46 am
-
I'm attempting to implement the tk2dParallaxCamera script with tk2dTileMap. The problem I'm facing is that the parallax layer is drawing on top of all other layers (instead of behind), and I can't figure out why. I've followed the example parallax project and everything seems to be in order as far as I can tell.
My tile map is setup as such:
(http://chattypics.com/files/tilemap_8i08buf5fa.png)
And my cameras:
(http://chattypics.com/files/cameraPNG_ihecxdk1pp.png)
(http://chattypics.com/files/camera1PNG_w1d2zr2r7t.png)
Do you notice anything wrong? Is there something else I'm not considering? Thanks.
-
The order with the parallax cameras is defined by camera depth parameter on each layers camera. Make sure they are in the order you want them to draw in.
-
I made sure that the main tk2dCamera has a depth of -1, and that the child parallax layer camera has a depth of -2, but now that layer isn't viewable at all in the game. Only when that camera has a depth of -1 (or higher) does that layer draw, but still on top of the the other layers. I've tried fiddling with the values in the same fashion but to no avail.
-
Turn off the cameras one at a time to make sure they are all set up properly. You can try making sure you have 1 camera which does the clear and everything else just clearing depth. This is most likely because something is writing to z when it isn't meant to or not clearing it when it needs to. Hard to guess how you have it set up.
-
It seems setting the sort layer order for the layers in the tile map, along with fiddling with other properties, resolved the issue. Thanks!