a guest Feb 3rd, 2019 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- // I have a Tile called tiles
- // I loop through all of the tiles
- foreach (Tile tile in tiles)
- // Skip null tiles
- if (tile == null) continue;
- // Get the texture
- Texture2D texture = tile.GetTexture(Content);
- // Render it using the Batcher from RenderableComponent's Graphics object
- transform.position + new Vector2(tilePosition.X * TileSize, tilePosition.Y * TileSize),
- // FOR SOME REASON THIS DEPTHLAYER IS IGNORED
- // For example, I have tried setting a Tile with a layer of 0.5, and another with a layer of 1, and it goes in order of the foreach loop rather than the layers' order.
- // Regardless of what the depthLayer values are, it will always go in order of the for loop (order of draw calls).
- // So is depthLayer useless?
- // For now, I've resorted to sorting the array using the Layer value before looping, but it would be nice to have it working without this "hack."
- // Thanks!
RAW Paste Data