IsWaterDrawnLast: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Remove obsolete Requirements section)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
{{New feature/item|4.0140|1.3.0|4585|
{{New feature/item|3.0130|1.3.0|4585|
This function get [[water]] rendering order.
This function determines whether [[water]] is drawn last in the rendering order.
}}<br />
}}
<br />


__NOTOC__
==Syntax==
{{Client function}}
<syntaxhighlight lang="lua"> bool isWaterDrawnLast ( )</syntaxhighlight>


===Returns===
Returns ''true'' if water is drawn last in the rendering order, ''false'' otherwise.
==Example==
This example toggles water to be drawn last.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool isWaterDrawLast()
function toggleWaterDrawnLast ()
    local bWaterDrawnLast = not isWaterDrawnLast()
    outputChatBox (string.format('setWaterDrawnLast: %s', tostring(bWaterDrawnLast)))
    return setWaterDrawnLast (bWaterDrawnLast)
end
addCommandHandler ('togglewater', toggleWaterDrawnLast)
</syntaxhighlight>
</syntaxhighlight>
===Returns===
Returns ''true'' if water drawn last in rendering order, ''false'' otherwise.
==Requirements==
{{Requirements|n/a|1.3.0.04585|}}


==See Also==
==See Also==
{{Client water functions}}
{{Client water functions}}
[[Category:Needs Example]]

Latest revision as of 17:08, 7 November 2024

This function determines whether water is drawn last in the rendering order.

Syntax

 bool isWaterDrawnLast ( )

Returns

Returns true if water is drawn last in the rendering order, 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