natives.getTexture

From GTA Connected
Jump to navigation Jump to search

Function Client Only icon-iv.png Online and Offline

Available since Client 1.0.0

object natives.getTexture(int txdId, string textureName)

The natives.getTexture function is used to Retrieves a texture handle from a loaded TXD by name.

Parameters

1) int txdId Handle ID of a previously loaded TXD.
2) string textureName Name of the texture inside the TXD.

Return

object Texture handle.

Notes

Examples

Example 1 - JavaScript:

addEventHandler("OnDrawnHUD", function() {

   const txdId = natives.loadTxd("frontend_360");
   const neonTex = natives.getTexture(txdId, "neon");
   if (neonTex) {
       // Draw the neon texture centered on screen
       natives.drawSprite(neonTex, 0.5, 0.5, 0.3, 0.2, 0, 255, 255, 255, 255);
   }

});

Compatibility

There isn't any compatibility information for this function.