EngineGetModelTextures: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|3.0157|1.5.7|20416|This function allows you to get the textures of any model.}} ==Syntax== <syntaxhighlight lang="lua">tabl...") |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client function}} | {{Client function}} | ||
{{New feature/item|3. | {{New feature/item|3.0160|1.5.7|20416|This function allows you to get the textures of any model.}} | ||
==Syntax== | ==Syntax== |
Revision as of 16:14, 3 May 2020
This function allows you to get the textures of any model.
Syntax
table engineGetModelTextures ( int/string model )
Required Arguments
- model: either the model ID or model name.
Returns
Returns a table of texture elements [textureName, texture], false otherwise.
Example
Click to collapse [-]
ClientGet the textures for model ID 3722 and draw them with dxDrawImage.
function init() textures = engineGetModelTextures(3722) addEventHandler("onClientRender", root, render) end addEventHandler("onClientResourceStart", resourceRoot, init) function render() local offset = 0 for name,texture in pairs(textures) do local size = dxGetPixelsSize(dxGetTexturePixels(texture)) dxDrawImage(0+offset, 0, size, size, texture) offset = offset + size end end
See Also
- engineAddImage
- engineApplyShaderToWorldTexture
- engineFreeModel
- engineGetModelFlags
- engineGetModelIDFromName
- engineGetModelLODDistance
- engineGetModelNameFromID
- engineGetModelPhysicalPropertiesGroup
- engineGetModelTextureNames
- engineGetModelTextures
- engineGetModelTXDID
- engineGetModelVisibleTime
- engineGetObjectGroupPhysicalProperty
- engineGetSurfaceProperties
- engineGetVisibleTextureNames
- engineImageGetFilesCount
- engineImageGetFiles
- engineImageGetFile
- engineImageLinkDFF
- engineImageLinkTXD
- engineImportTXD
- engineLoadCOL
- engineLoadDFF
- engineLoadIMG
- engineLoadIFP
- engineLoadTXD
- engineRemoveImage
- engineRemoveShaderFromWorldTexture
- engineReplaceAnimation
- engineReplaceCOL
- engineReplaceModel
- engineRequestModel
- engineResetModelFlags
- engineResetModelLODDistance
- engineResetSurfaceProperties
- engineRestoreAnimation
- engineRestoreCOL
- engineRestoreDFFImage
- engineRestoreModel
- engineRestoreModelPhysicalPropertiesGroup
- engineRestoreObjectGroupPhysicalProperties
- engineRestoreTXDImage
- engineRestreamWorld
- engineSetAsynchronousLoading
- engineSetModelFlag
- engineSetModelFlags
- engineSetModelLODDistance
- engineSetModelPhysicalPropertiesGroup
- engineSetModelVisibleTime
- engineSetObjectGroupPhysicalProperty
- engineSetSurfaceProperties
- engineStreamingFreeUpMemory
- engineStreamingGetUsedMemory