natives.loadTxd: Difference between revisions
Jump to navigation
Jump to search
ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.loadTxd |parameters = string txdName |parameter1 = string txdName Name of the TXD (texture dictionary) to load |usage = Loads a texture dictionary (TXD) into memory so its textures can be accessed |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 te...") |
(No difference)
|
Latest revision as of 00:33, 28 November 2025
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.