SetWaterDrawnLast: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} {{New feature/item|4.0140|1.3.1|4585| This function change water rendering order. }}<br /> <br /> __NOTOC__ {{Client function}} <lua>[lua] b...")
 
(Remove obsolete Requirements section)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
{{New feature/item|4.0140|1.3.1|4585|
This function change [[water]] rendering order.
}}<br />
<br />


__NOTOC__
{{New feature/item|3.0130|1.3.0|4585|
{{Client function}}
This function changes the [[water]] rendering order.
}}


<lua>[lua]
==Syntax==
bool setWaterDrawLast( bool bEnabled )
<syntaxhighlight lang="lua">bool setWaterDrawnLast ( bool bEnabled )</syntaxhighlight>
</lua>


===Required Arguments===
===Required Arguments===
*'''bEnabled''': A boolean value determining water drawn last.  
*'''bEnabled''': A boolean value determining whether water should be drawn last.  


===Returns===
===Returns===
Returns ''true'' if set water drawn last is successfully, ''false'' otherwise.
Returns ''true'' if the rendering order was changed successfully, ''false'' otherwise.


==Requirements==
==Example==
{{Requirements|n/a|1.3.1.04585|}}
This example toggles water to be drawn last.
<syntaxhighlight lang="lua">
function toggleWaterDrawnLast ()
local bWaterDrawnLast = not isWaterDrawnLast()
outputChatBox (string.format('setWaterDrawnLast: %s', tostring(bWaterDrawnLast)))
return setWaterDrawnLast (bWaterDrawnLast)
end
addCommandHandler ('togglewater', toggleWaterDrawnLast)
</syntaxhighlight>


==See Also==
==See Also==
{{Client water functions}}
{{Client water functions}}

Latest revision as of 17:08, 7 November 2024

This function changes the water rendering order.

Syntax

bool setWaterDrawnLast ( bool bEnabled )

Required Arguments

  • bEnabled: A boolean value determining whether water should be drawn last.

Returns

Returns true if the rendering order was changed successfully, false otherwise.

Example

This example toggles water to be drawn last.

function toggleWaterDrawnLast ()
	local bWaterDrawnLast = not isWaterDrawnLast()
	outputChatBox (string.format('setWaterDrawnLast: %s', tostring(bWaterDrawnLast)))
	return setWaterDrawnLast (bWaterDrawnLast)
end
addCommandHandler ('togglewater', toggleWaterDrawnLast)

See Also