PaintTileTextureCoordinates
Introduction
Code Example
// assuming map is a valid MapDrawableBatch:
var position = new Vector3(0,0,0);
var size = new Vector2 (16, 16);
// Note that AddTile uses pixels for the texture...
var index = map.AddTile(position, size, 0,0, 16, 16);
// now the index can be used to paint a different texture coordinate.
// Note that this uses texture coordinates not pixel coordinates:
// Here we use consts for the texture size to keep things simple but
// your code should use your actual texture size.
const float textureWidth = 1024;
const float textureHeight = 1024;
map.PaintTileTextureCoordinates(index, 32/textureWidth, 32/textureHeight);Last updated
Was this helpful?