Difference between revisions of "SetSceneBrightness (CMS)"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "{| class="wikitable" style="width:100%" |- ! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left" | By |- | setSceneBrightness("scn" ''o...")
 
Line 33: Line 33:
 
{| class="wikitable" style="width:100%"
 
{| class="wikitable" style="width:100%"
 
|-
 
|-
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:70%" | Description
+
! style="text-align:left" | Name !! style="text-align:left" | Type !! style="text-align:left;width:80%" | Description
 
|-
 
|-
 
| scn || "string" ''or'' <span class="blue">nil</span> || This should be a "string" value containing the name of the scene you want to affect else it should contain the word ''<span class="blue">nil</span>''.
 
| scn || "string" ''or'' <span class="blue">nil</span> || This should be a "string" value containing the name of the scene you want to affect else it should contain the word ''<span class="blue">nil</span>''.

Revision as of 20:00, 14 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.