Difference between revisions of "GetVolume"
From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: | Line 1: | ||
− | + | ==getVolume== | |
− | |||
− | |||
− | |||
− | |||
− | |||
+ | <div class="command-min-version-info">Available since: <span class="command-min-version">v3.0</span></div> | ||
− | + | <div class="command-doc">Returns the general volume for background music, sound or speech output.</div> | |
− | <div class=" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Lua Syntax: | |
− | Syntax: | + | <pre class="command-syntax">getVolume(type)</pre> |
− | < | + | ===Arguments=== |
− | getVolume(type) | + | ====type==== |
− | </ | + | :'''int''' - The type of volume to return: eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4). |
− | + | ===Flags=== | |
− | + | ===Return Values=== | |
− | Example: | + | ;volume |
+ | :The queried volume. | ||
+ | ===Examples=== | ||
+ | Example 1: | ||
<syntaxhighlight> | <syntaxhighlight> | ||
-- is music volume over 50%? | -- is music volume over 50%? | ||
if getVolume(eMusicVolume) > 50 then | if getVolume(eMusicVolume) > 50 then | ||
− | + | -- do some action | |
end | end | ||
− | + | </syntaxhighlight> | |
− | + | Example 2: | |
− | + | <syntaxhighlight> | |
− | |||
− | |||
− | |||
-- is speech volume more than or equal to 80%? | -- is speech volume more than or equal to 80%? | ||
if getVolume(eSpeechVolume) >= 80 then | if getVolume(eSpeechVolume) >= 80 then | ||
− | + | -- do some action | |
end | end | ||
− | + | </syntaxhighlight> | |
− | + | Example 3: | |
− | + | <syntaxhighlight> | |
− | |||
− | |||
− | |||
-- is global (master) volume not equal to 50%? | -- is global (master) volume not equal to 50%? | ||
if getVolume(eGlobalVolume) ~= 50 then | if getVolume(eGlobalVolume) ~= 50 then | ||
− | + | -- do some action | |
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 17:12, 22 November 2013
getVolume
Available since: v3.0
Returns the general volume for background music, sound or speech output.
Lua Syntax:
getVolume(type)
Arguments
type
- int - The type of volume to return: eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4).
Flags
Return Values
- volume
- The queried volume.
Examples
Example 1:
-- is music volume over 50%?
if getVolume(eMusicVolume) > 50 then
-- do some action
end
Example 2:
-- is speech volume more than or equal to 80%?
if getVolume(eSpeechVolume) >= 80 then
-- do some action
end
Example 3:
-- is global (master) volume not equal to 50%?
if getVolume(eGlobalVolume) ~= 50 then
-- do some action
end