EngineLoadIMG: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
m (Add note for possible fixes)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
{{Client function}}
{{Client function}}
__NOTOC__
{{New feature/item|3.0161|1.6.0|21708|This function loads an IMG container into GTA. '''Only 2 IMG archives can be loaded into GTA'''
{{New feature/item|4|1.6.0|21708|This function loads an IMG container into GTA.}}
}}
{{Note|You can't load more than 2 IMG's due to GTA limitations.
{{Note|
IMG size can't be bigger than 1GB. (MTA limitation)}}
If you're experiencing crashes/game hangs with default values, try to adjust memory/buffer/cache sizes with [[engineStreamingSetMemorySize]], [[engineStreamingSetBufferSize]] and/or [[engineStreamingSetModelCacheLimits]].}}
 
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">img engineLoadIMG( string img_file )</syntaxhighlight>
<syntaxhighlight lang="lua">
img engineLoadIMG ( string img_file )
</syntaxhighlight>
{{OOP||[[DFF|EngineIMG]]}}
{{OOP||[[DFF|EngineIMG]]}}
===Required Arguments===
===Required Arguments===
Line 12: Line 16:
===Returns===
===Returns===
Returns an [[IMG]] element if the [[IMG]] file loaded, ''false'' otherwise.
Returns an [[IMG]] element if the [[IMG]] file loaded, ''false'' otherwise.
===Examples===
This example loads IMG file from directory and then prints number of files in it
<syntaxhighlight lang="lua">
local img = engineLoadIMG('file.img')
iprint('Number of files: ',#engineImageGetFiles(img))
</syntaxhighlight>


==See Also==
==See Also==
{{Engine_functions}}
{{Engine_functions}}
[[Category:Changes in 1.6.0]]
[[Category:Changes in 1.6.0]]

Latest revision as of 18:32, 5 January 2024

ADDED/UPDATED IN VERSION 1.6.0 r21708:
This function loads an IMG container into GTA. Only 2 IMG archives can be loaded into GTA
[[{{{image}}}|link=|]] Note:

If you're experiencing crashes/game hangs with default values, try to adjust memory/buffer/cache sizes with engineStreamingSetMemorySize, engineStreamingSetBufferSize and/or engineStreamingSetModelCacheLimits.

Syntax

img engineLoadIMG ( string img_file )

OOP Syntax Help! I don't understand this!

Method: EngineIMG(...)


Required Arguments

  • img_file: The filepath to the IMG file you want to load.

Returns

Returns an IMG element if the IMG file loaded, false otherwise.

Examples

This example loads IMG file from directory and then prints number of files in it

local img = engineLoadIMG('file.img')

iprint('Number of files: ',#engineImageGetFiles(img))

See Also