Hello Guest

Author Topic: Can't draw one sprite moving through the middle of another rotated sprite  (Read 3251 times)

Jodacola

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
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:



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!

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
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.

Jodacola

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 2
    • View Profile
Thanks!  :)