Reputation: 111
I'm trying to make a little isometric game.There are objects and players.
In init function;
drawObject();
drawPlayer();
So in screen player always shown in top of objects because player drawn after objects but it should be like that; if y-coordinate of the object is more than the player's y-coordinate then object must be drawn later and shown on top. Or is there anything like z-index
property for drawImage()
function for canvas?
Upvotes: 0
Views: 652
Reputation: 128927
No, there is no z-index property for the Canvas. The canvas will be drawn in the order you code your drawing primitives.
Upvotes: 3