SetSkyGradient: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (Updated syntax) |
||
(11 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This function changes the sky color to a gradient. | {{Server client function}} | ||
This function changes the sky color to a two-color gradient. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setSkyGradient ( [ int topRed = 0, int topGreen = 0, int topBlue = 0, int bottomRed = 0, int bottomGreen = 0, int bottomBlue = 0 ] ) | bool setSkyGradient ( [ int topRed = 0, int topGreen = 0, int topBlue = 0, int bottomRed = 0, int bottomGreen = 0, int bottomBlue = 0 ] ) | ||
Line 9: | Line 10: | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
{{OptionalArg}} | {{OptionalArg}} | ||
*''' | *'''topRed:''' The ''red'' value of the upper part of the sky, from 0 to 255. | ||
*''' | *'''topGreen:''' The ''green'' value of the upper part of the sky, from 0 to 255. | ||
*'''topBlue:''' The ''blue'' value of the upper part of the sky, from 0 to 255. | |||
*'''bottomRed:''' The ''red'' value of the lower part of the sky, from 0 to 255. | |||
*'''bottomGreen:''' The ''green'' value of the lower part of the sky, from 0 to 255. | |||
*'''bottomBlue:''' The ''blue'' value of the lower part of the sky, from 0 to 255. | |||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if sky color was set correctly, ''false'' if invalid values were passed. | ||
==Example== | ==Example== | ||
This example sets the sky to a hot pink gradient. | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function ClientStarted () | |||
setSkyGradient( 200, 0, 100, 150, 0, 70 ) | |||
end | |||
addEventHandler( "onClientResourceStart", resourceRoot, ClientStarted ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
This example will set a blue '''realistic sky'''. | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
function ClientStarted () | |||
setSkyGradient( 60, 100, 196, 136, 170, 212 ) | |||
end | |||
addEventHandler( "onClientResourceStart", resourceRoot, ClientStarted ) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{ | {{World functions}} | ||
[[ | |||
[[ru:setSkyGradient]] |
Latest revision as of 14:03, 6 January 2022
This function changes the sky color to a two-color gradient.
Syntax
bool setSkyGradient ( [ int topRed = 0, int topGreen = 0, int topBlue = 0, int bottomRed = 0, int bottomGreen = 0, int bottomBlue = 0 ] )
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- topRed: The red value of the upper part of the sky, from 0 to 255.
- topGreen: The green value of the upper part of the sky, from 0 to 255.
- topBlue: The blue value of the upper part of the sky, from 0 to 255.
- bottomRed: The red value of the lower part of the sky, from 0 to 255.
- bottomGreen: The green value of the lower part of the sky, from 0 to 255.
- bottomBlue: The blue value of the lower part of the sky, from 0 to 255.
Returns
Returns true if sky color was set correctly, false if invalid values were passed.
Example
This example sets the sky to a hot pink gradient.
Click to collapse [-]
Clientfunction ClientStarted () setSkyGradient( 200, 0, 100, 150, 0, 70 ) end addEventHandler( "onClientResourceStart", resourceRoot, ClientStarted )
This example will set a blue realistic sky.
Click to collapse [-]
Clientfunction ClientStarted () setSkyGradient( 60, 100, 196, 136, 170, 212 ) end addEventHandler( "onClientResourceStart", resourceRoot, ClientStarted )
See Also
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel