Difference between revisions of "GetVolume"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Redirected page to Global Command: getVolume)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
+
#REDIRECT [[Global Command: getVolume]]
<b>Command History</b>
 
<div class="mw-collapsible-content">
 
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
 
<div>MovieVolume & GlobalVolume added to <span style="color:orange">v3.8</span></div>
 
</div></div>
 
 
 
 
 
Allows the user to check current volume levels of: music, sound fx, speech, movies & global(master)
 
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
 
<b>Additional Info</b>
 
<div class="mw-collapsible-content">
 
<div>These are the numbers used inside of the getVolume(brackets) to check specific volume types! <br/>
 
<pre>eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4)</pre></div>
 
</div></div>
 
 
 
 
 
Syntax:
 
<syntaxhighlight>
 
getVolume(type)
 
</syntaxhighlight>
 
 
 
 
 
Example:
 
<syntaxhighlight>
 
-- is music volume over 50%?
 
if getVolume(0) > 50 then
 
-- do some action!
 
end
 
 
 
-- is sound fx volume less than 25%?
 
if getVolume(1) < 25 then
 
-- do some action!
 
end
 
 
 
-- is speech volume more than or equal to 80%?
 
if getVolume(2) >= 80 then
 
-- do some action!
 
end
 
 
 
-- is movie volume at 50%?
 
if getVolume(3) == 50 then
 
-- do some action!
 
end
 
 
 
-- is global (master) volume not equal to 50%?
 
if getVolume(4) ~= 50 then
 
-- do some action!
 
end
 
</syntaxhighlight>
 
 
 
 
 
 
 
<b><u>Arguments</u></b>
 
 
 
<b>type</b>: integer (number) <br/>
 
The type of volume to return: eMusicVolume (0), eSoundVolume (1), eSpeechVolume (2), eMovieVolume (3) or eGlobalVolume (4)
 
 
 
 
 
<b><u>Flags</u></b>
 
 
 
none
 
 
 
 
 
<b><u>Return</u></b>
 
 
 
<b>volume</b> <br/>
 
The queried volume
 
{{i18n|GetVolume}} <br/>
 
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
 
|-
 
|<b>Relevant Pages</b>: [[SetVolume|setVolume]]
 
|}
 

Latest revision as of 12:26, 19 May 2023