EngineImageGetFile: Difference between revisions
Jump to navigation
Jump to search
m (Changed return "type" to a valid one) |
TheNormalnij (talk | contribs) (Fix API description, add example) |
||
(One intermediate revision by one other user not shown) | |||
Line 3: | Line 3: | ||
{{New feature/item|4|1.6.0|21695|This function gets a file from an IMG container.}} | {{New feature/item|4|1.6.0|21695|This function gets a file from an IMG container.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string engineImageGetFile ( img img_file, string/number file ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[ | {{OOP||[[img]]:getFile||}} | ||
===Required Arguments=== | ===Required Arguments=== | ||
* '''img_file''': The [[IMG]] file you want to get file from. | * '''img_file''': The [[IMG]] file you want to get file from. | ||
* ''' | * '''file''': Name or position of the file you want to get. | ||
===Returns=== | ===Returns=== | ||
Returns file's binary data if successful, false otherwise. | Returns file's binary data if successful, false otherwise. Data size is bonded to 2 Kb block size. | ||
==Example== | |||
You could use the following code: | |||
<syntaxhighlight lang="lua"> | |||
local img = engineLoadIMG( "file.img" ) | |||
local data = engineImageGetFile( img, 'test.dff' ) | |||
local dff = engineLoadDFF( data ) | |||
engineReplaceModel ( dff, 400 ) | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{Engine_functions}} | {{Engine_functions}} |
Latest revision as of 19:27, 10 April 2023
Syntax
string engineImageGetFile ( img img_file, string/number file )
OOP Syntax Help! I don't understand this!
- Method: img:getFile(...)
Required Arguments
- img_file: The IMG file you want to get file from.
- file: Name or position of the file you want to get.
Returns
Returns file's binary data if successful, false otherwise. Data size is bonded to 2 Kb block size.
Example
You could use the following code:
local img = engineLoadIMG( "file.img" ) local data = engineImageGetFile( img, 'test.dff' ) local dff = engineLoadDFF( data ) engineReplaceModel ( dff, 400 )
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