# PaintTileTextureCoordinates

### Introduction

PaintTileTextureCoordinates can be used to change the texture coordinates on a tile by its ordered index. This method can specify all four coordiantes (left, top, right, bottom) or just the top and left. If only the top and left are specified, the bottom and right are automatically determined based on the tileset's tile dimensions.

### Code Example

Note that this requires the ordered tile index. This sample assumes that tiles have been added manually, and then painted later.

```lang:c#
// 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);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flatredball.com/flatredball/tiled-plugin/flatredball-tilegraphics-mapdrawablebatch/painttiletexturecoordinates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
