# engineSetTxdTextureSampling (Client)

> Overrides how the world samples a txd's texture: what happens past its edges and how it is filtered. It takes the place of the material's own addressing.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Textures
- **URL**: https://wiki.mymp.gg/en/engineSetTxdTextureSampling

## Syntax

```lua
bool engineSetTxdTextureSampling(txd|string txd, string name [, string edge = nil, string filter = nil, int priority = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `txd` | `txd\|string` | A `txd` element, a txd's name, or a glob pattern. |
| `name` | `string` | The texture's name, or a glob pattern. |
| `edge` | `string` | `wrap`, `mirror`, `clamp`, `border` or `mirror-once`. `nil` leaves the edge as shipped. *(default: `nil`)* |
| `filter` | `string` | `linear` or `point`. `nil` leaves the filter as shipped. *(default: `nil`)* |
| `priority` | `int` | Among several overrides for the same texture, the highest priority answers; among equals, the newest. *(default: `0`)* |

## Returns

`true` once the override is set. Raises an error if neither `edge` nor `filter` is given, or if a value is unknown.

## Example

```lua
engineSetTxdTextureSampling("infernus", "*", "clamp", "point")
```

## See also

- [engineRestoreTxdTextureSampling (Client)](https://wiki.mymp.gg/en/engineRestoreTxdTextureSampling.md): Removes the sampling override this resource set on a txd's texture with engineSetTxdTextureSampling.
- [engineSetTxdTexture (Client)](https://wiki.mymp.gg/en/engineSetTxdTexture.md): Puts an image in a txd under a texture name, replacing the texture of that name or adding a new one. Everything that reads the txd follows: models, peds, landscapes, roads, particles, water and sky.
- [dxSetTextureEdge (Client)](https://wiki.mymp.gg/en/dxSetTextureEdge.md): Chooses what an image shows when it is read outside its edges.
