EngineRemoveShaderFromWorldTexture: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Added OOP syntax introduced in r6987)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
{{New feature|3.0110|1.1|
This function removes a [[shader]] from one or more world textures.
Only available in 1.1
}}
This function removes a [[shader]] from one texture of a model.


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool engineRemoveShaderFromModel ( element shader, int modelID, string textureName )
bool engineRemoveShaderFromWorldTexture ( element shader, string textureName [, element targetElement = nil ] )
</syntaxhighlight>  
</syntaxhighlight>
{{New feature/item|3.0141|1.4.0|6987|{{OOP||[[shader]]:removeFromWorldTexture}}}}


===Required Arguments===  
===Required Arguments===  
*'''shader:''' The shader which is to be removed
*'''shader:''' The shader which is to be removed
*'''modelID:''' The model id to find the texture
*'''textureName:''' The name of the world texture to remove the shader from. It should be exactly the same string as used with [[engineApplyShaderToWorldTexture]] when the shader was initially applied.
*'''textureName :''' The name of the texture in the model to remove the shader from
 
===Optional Arguments===
{{New feature/item|3.0130|1.3.0|4140|
*'''targetElement:''' The element to remove the shader from. It should be the same element as used with [[engineApplyShaderToWorldTexture]] when the shader was initially applied.
}}


===Returns===
===Returns===
Returns ''true'' if the shader was successfully removed from the model, ''false'' otherwise.
Returns ''true'' if the shader was successfully removed, ''false'' otherwise.


==Example==
==Example==
This example will remove a previously created shader from the "des_logwall" texture of model 11490
This example will remove a previously created shader from the "des_logwall" world texture
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
engineRemoveShaderFromModel( myShader, 11490, "des_logwall" )
engineRemoveShaderFromWorldTexture ( myShader, "des_logwall" )
</syntaxhighlight>
</syntaxhighlight>
==Changelog==
{{ChangelogHeader}}
{{ChangelogItem|1.3.0-9.04140|Added targetElement argument}}


==See Also==
==See Also==
{{Engine_functions}}
{{Engine_functions}}
{{Drawing_functions}}
{{Drawing_functions}}

Latest revision as of 09:47, 30 December 2014

This function removes a shader from one or more world textures.

Syntax

bool engineRemoveShaderFromWorldTexture ( element shader, string textureName [, element targetElement = nil ] )

OOP Syntax Help! I don't understand this!

Method: shader:removeFromWorldTexture(...)

Required Arguments

  • shader: The shader which is to be removed
  • textureName: The name of the world texture to remove the shader from. It should be exactly the same string as used with engineApplyShaderToWorldTexture when the shader was initially applied.

Optional Arguments

  • targetElement: The element to remove the shader from. It should be the same element as used with engineApplyShaderToWorldTexture when the shader was initially applied.

Returns

Returns true if the shader was successfully removed, false otherwise.

Example

This example will remove a previously created shader from the "des_logwall" world texture

engineRemoveShaderFromWorldTexture ( myShader, "des_logwall" )

Changelog

Version Description
1.3.0-9.04140 Added targetElement argument

See Also