Notice: Failed to invoke Pygments: [Called from MediaWiki\SyntaxHighlight\SyntaxHighlight::highlightInner in /home/pi/www/gtac/wiki/wiki/extensions/SyntaxHighlight_GeSHi/includes/SyntaxHighlight.php at line 334] in /home/pi/www/gtac/wiki/wiki/includes/debug/MWDebug.php on line 507

Notice: Failed to invoke Pygments: [Called from MediaWiki\SyntaxHighlight\SyntaxHighlight::highlightInner in /home/pi/www/gtac/wiki/wiki/extensions/SyntaxHighlight_GeSHi/includes/SyntaxHighlight.php at line 334] in /home/pi/www/gtac/wiki/wiki/includes/debug/MWDebug.php on line 507
natives.getTextureFromStreamedTxd - GTA Connected

natives.getTextureFromStreamedTxd

Revision as of 00:44, 28 November 2025 by ChrisGame20 (talk | contribs) (Created page with "{{ScriptItem |endpoint = client |games = iv |type = function |name = natives.getTextureFromStreamedTxd |parameters = string txdName, string textureName |parameter1 = string txdName Name of the streamed TXD previously requested |parameter2 = string textureName Name of the texture inside the streamed TXD |usage = Retrieves a texture handle from a streamed TXD by name |notes = - Requires that the TXD has been requested with natives.requestStreamedTxd - Allows accessing...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Function Client Only icon-iv.png Online and Offline

Available since Client 1.0.0
object natives.getTextureFromStreamedTxd(string txdName, string textureName)
The natives.getTextureFromStreamedTxd function is used to Retrieves a texture handle from a streamed TXD by name.

Parameters

1) string txdName Name of the streamed TXD previously requested.
2) string textureName Name of the texture inside the streamed TXD.

Return

object Texture handle.

Notes

  • - Requires that the TXD has been requested with natives.requestStreamedTxd- Allows accessing textures that are **not limited to the core texture folder**, since streamed TXDs can come from other game assets.

Examples

Example 1 - JavaScript:

addEventHandler("OnDrawnHUD", function() {
    // Request and then get a texture from a streamed TXD
    natives.requestStreamedTxd("w_glock", true);
    const tex = natives.getTextureFromStreamedTxd("w_glock", "icon");
    if (tex) {
        natives.drawSprite(tex, 0.5, 0.5, 0.1, 0.1, 0, 255, 255, 255, 255);
    }
});

Compatibility

There isn't any compatibility information for this function.