Difference between revisions of "SetSceneBrightness (CMS)"
From The Official Visionaire Studio: Adventure Game Engine Wiki
m (Text replacement - "wikitable" to "ts") |
|||
Line 1: | Line 1: | ||
− | {| class=" | + | {| class="ts" style="width:100%" |
|- | |- | ||
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By | ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By | ||
Line 31: | Line 31: | ||
== Syntax Breakdown == | == Syntax Breakdown == | ||
− | {| class=" | + | {| class="ts" style="width:100%" |
|- | |- | ||
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description | ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description |
Revision as of 18:22, 19 August 2014
Name | Type | By |
---|---|---|
setSceneBrightness("scn" or nil, n) | Definition | AFRLme |
This small function allows you to quickly set the brightness value of the current scene or a specific scene.
Instructions
1. Add the main script to the Visionaire Studio Script Editor & set the script as a definition script.
2a. To use this function you should create an execute a script action containing...
setSceneBrightness("scene_name", 80) -- sets the linked scenes brightness value to 80%
2b. Alternatively to automatically link to current scene use this method...
setSceneBrightness(nil, 80) -- sets the current scenes brightness value to 80%
Main Script
function setSceneBrightness(scn, n)
if scn ~= nil then
getObject("Scenes[" .. scn .. "]"):setValue(VSceneBrightness, n)
else
game:getLink(VGameCurrentScene):setValue(VSceneBrightness, n)
end
end
Syntax Breakdown
Name | Type | Description |
---|---|---|
scn | "string" or nil | This should be a "string" value containing the name of the scene you want to affect else it should contain the word nil. |
n | integer | This should be an integer (number) value which will determine the brightness value of the linked scene (scn) or the current scene if nil was used. |