Global Command: getWindowBrightness: Difference between revisions

From The Official Visionaire Studio: Adventure Game Engine Wiki
mNo edit summary
EK (talk | contribs)
No edit summary
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
Returns the brightness (gamma) of the window. A value of 0 is completely dark, 100 is normal brightness.
<span class="bold">Function History</span>
<div class="mw-collapsible-content">
<div class="alt-bg">Available since v3.8</div>
</div></div>


{| class="ts"
|-
| style="width:15%" | Related functions
| [[Global Command: setWindowBrightness|setWindowBrightness]]
|}


Returns the integer value of global window brightness. (min = 0, max = 100)


 
== Syntax ==
Syntax:
<syntaxhighlight lang="lua">
<syntaxhighlight>
getWindowBrightness()
getWindowBrightness()
</syntaxhighlight>
</syntaxhighlight>




Example:
== Parameters ==
<syntaxhighlight>
-- check if brightness value is less than 50%?
if getWindowBrightness() < 50 then
-- do something...
end
</syntaxhighlight>
 
 


<span class="bold underline">Arguments</span><br/>
none
none




<span class="bold underline">Flags</span><br/>
== Return values ==
none
{| class="ts"
|-
! style="width:15%" | Type
! Description
|-
| integer
| The current gamma/brightness value.
|}




<span class="bold underline">Return</span><br/>
== Examples ==
'''brightness''' <br/>
The integer value of global window brightness.


 
'''Example 1:''' Do something, if the brightness value is less than 50%.
 
<syntaxhighlight lang ="lua">
{| class="tbl-ds"
if getWindowBrightness() < 50 then
|-
  -- do something
|<span class="bold">Relevant Pages</span>: [[SetWindowBrightness_(CMS)|setWindowBrightness]]
end
|}
</syntaxhighlight>
{{toc}}

Revision as of 22:41, 15 May 2023

Returns the brightness (gamma) of the window. A value of 0 is completely dark, 100 is normal brightness.

Related functions setWindowBrightness


Syntax

getWindowBrightness()


Parameters

none


Return values

Type Description
integer The current gamma/brightness value.


Examples

Example 1: Do something, if the brightness value is less than 50%.

if getWindowBrightness() < 50 then
  -- do something
end