0
\$\begingroup\$

When you are looking at this image:

Player behind tree

the player is standing behind the tree. I know that can be accomplished by drawing the background first the player second and the upper tree part after that.

The thing is in the actual tileset there is only one tile that combines the background and the upper tree part:

Upper tree tile

So how is it possible that there are multiple z-indices within one tile. Or is the game somehow extracting the upper tree part from the base grass texture and draw them like described earlier?

\$\endgroup\$
7
  • \$\begingroup\$ Is it possible there's a mask somewhere else in the texture atlas? Or in another image? \$\endgroup\$ – user1118321 Feb 27 '18 at 5:45
  • \$\begingroup\$ @user1118321 As far as i know there is only this texture and the base grass texture. \$\endgroup\$ – Nimmi Feb 27 '18 at 6:20
  • \$\begingroup\$ If you have the base grass texture, you could generate a mask by differencing that with the one that has the tree in it. \$\endgroup\$ – user1118321 Feb 27 '18 at 6:21
  • \$\begingroup\$ @user1118321 hmm, i will give it shot. Although that sounds very inefficient if you have to do that with every tile that is overlapping. But we will see. Thanks for your help. \$\endgroup\$ – Nimmi Feb 27 '18 at 6:32
  • \$\begingroup\$ That texture is most likely closed by someone who ripped it. This is most likely with transparent background originally. \$\endgroup\$ – Mario Feb 27 '18 at 6:47
2
\$\begingroup\$

As stated in the comments, that texture has a transparent background in the original game. That way they can just draw the base grass, then the player, then the tree.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.