engineSetTxdTexture
Client
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.
bool engineSetTxdTexture(txd|string txd, string name, texture|dui|bool source [, int priority = 0])
Parameters
| Name | Type | Description |
|---|---|---|
| txd | txd|string | A txd element, a txd's name, or a glob pattern matching several txds. |
| name | string | The texture's name, or a glob pattern. |
| source | texture|dui|bool | A texture (a file texture, render target, screen source or txd texture), a dui, or false to hide the texture. |
| priority | int | Among several links for the same texture, the highest priority answers; among equals, the newest.default 0 |
Returns
true once the link is made. Raises an error if the txd does not exist or the source is not an image or false.
A link to a txd texture follows that txd's own links, 8 deep at most. The resource's links go when it stops or when engineRestoreTxdTexture removes them.
Example
local plate = engineCreateTexture("images/plate.png")
engineSetTxdTexture("infernus", "vehiclelights128", plate)
engineSetTxdTexture("*", "graffiti*", false)