natives.loadTxd
Jump to navigation
Jump to search
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
int natives.loadTxd(string txdName)
The natives.loadTxd function is used to Loads a texture dictionary (TXD) into memory so its textures can be accessed.
Parameters
| 1) | string | txdName | Name of the TXD (texture dictionary) to load. |
Return
| int | Handle ID of the loaded TXD. |
Notes
- - Must be called before using natives.getTexture or natives.drawSprite with textures from that TXD- This native can only load texture dictionaries that exist inside the **game’s texture folder**; it does not load external or custom files.
Examples
Example 1 - JavaScript:
bindEventHandler("OnResourceReady", thisResource, function() {
const txdId = natives.loadTxd("frontend_360");
if (txdId) {
console.log("TXD frontend_360 loaded with ID " + txdId);
}
});
Compatibility
There isn't any compatibility information for this function.