2D Toolkit Forum
2D Toolkit => Support => Topic started by: Jodacola on March 04, 2014, 05:27:07 pm
-
Hi! Perhaps this is my lack of experience in regard to 2D Toolkit speaking, but I'm a bit confused about something.
Background:
I'm using a standard orthographic tk2dCamera.
I have a sprite (we'll call it Sprite A) that moves horizontally, at the default rotation. Sprite A, at some point, moves through another sprite (Sprite B). Sprite B is rotated 45 degrees, and is on the same plane as Sprite A.
What I was expecting to happen was that Sprite B would be intersected in the middle by Sprite A, giving the impression that Sprite A is flying "through" Sprite B. Instead, Sprite B is always on top of Sprite A, even though half of it is, in 3D space, behind Sprite A. Here's an illustration:
(http://jodaco.net/files/tk2dq.png)
Is this expected behavior? I'm sure I've left out some critical information, so let me know if I can provide anything else. I can also put together a small test project, if necessary.
Thank you!
-
Sprite A doesn't write into depth (its transparent) so you won't have the effect of sprite B cutting through the sprite. It will simply draw in front. If you want it to cut through you'll need to make sprite A solid / masked.
-
Thanks! :)