Graphics::requestStreamedTextureDict: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
(Added example)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
last param isnt a toggle==Syntax==<syntaxhighlight lang="javascript">graphics.requestStreamedTextureDict(textureDict, p1);</syntaxhighlight>=== Required Arguments ===*'''textureDict:''' String*'''p1:''' Boolean===Return value===*'''Undefined'''==Example==<syntaxhighlight lang="javascript">todo</syntaxhighlight>==See also=={{Graphics_function_c}}[[Category:Clientside API]][[Category:TODO: Example]]
Requests the specified texture dictionary.
==Syntax==
<syntaxhighlight lang="javascript">mp.game.graphics.requestStreamedTextureDict(textureDict, p1);</syntaxhighlight>
=== Required Arguments ===
*'''textureDict:''' String
*'''p1:''' Boolean
===Return value===
*'''Undefined'''
==Example==
{{ClientSide}}
<syntaxhighlight lang="javascript">
// This function will load the specified texture dictionary.
function loadTextureDictionary(textureDict) {
    if (!mp.game.graphics.hasStreamedTextureDictLoaded(textureDict)) {
        mp.game.graphics.requestStreamedTextureDict(textureDict, true);
        while (!mp.game.graphics.hasStreamedTextureDictLoaded(textureDict)) mp.game.wait(0);
    }
}
 
loadTextureDictionary("commonmenu"); // will load commonmenu.ytd
</syntaxhighlight>
==See also==
{{Graphics_s_function_c}}
[[Category:Clientside API]]
[[Category:TODO: Example]]

Latest revision as of 15:44, 5 July 2018

Requests the specified texture dictionary.

Syntax

mp.game.graphics.requestStreamedTextureDict(textureDict, p1);

Required Arguments

  • textureDict: String
  • p1: Boolean

Return value

  • Undefined

Example

Client-Side
// This function will load the specified texture dictionary.
function loadTextureDictionary(textureDict) {
    if (!mp.game.graphics.hasStreamedTextureDictLoaded(textureDict)) {
        mp.game.graphics.requestStreamedTextureDict(textureDict, true);
        while (!mp.game.graphics.hasStreamedTextureDictLoaded(textureDict)) mp.game.wait(0);
    }
}

loadTextureDictionary("commonmenu"); // will load commonmenu.ytd

See also