Skip to content

static class Sky (client-side)

Available since version: 0.1.6

This class represents in game Sky.

Properties

int weather

Available since version: 0.1.10

Represents the sky weather. For more information see Weather constants.


bool raining

Available since version: 0.1.10

Represents the raining/snowing state.


bool renderLightning

Available since version: 0.1.10

Represents the lightning feature during raining state.
Lightning will only be rendered during raining and when weatherWeight is larger than 0.5


float windScale

Available since version: 0.1.10

Represents the sky wind scale used during raining/snowing.


float weatherWeight (read-only)

Available since version: 0.1.10

Represents the sky weather condition development in range 0.0 to 1.0.
When it starts raining/snowing this value gradually increases to 1.0.
When it stops raining/snowing this value gradually decreases back to near 0.0.


bool dontRain

Available since version: 0.1.10

Represents the sky dontRain feature.
When it's enabled, the rain/snow won't fall.


bool darkSky

Available since version: 0.1.10

Represents the dark sky feature. When it's enabled, the sun clouds are dark.


Methods

setRainStartTime

Available since version: 0.1.10

This method will set the sky weather time when it starts raining/snowing.

void setRainStartTime(int hour, int min)

Parameters:

  • int hour: the sky weather raining start hour.
  • int min: the sky weather raining start min.

getRainStartTime

Available since version: 0.1.10

This method will get the sky weather time when it starts raining/snowing.

{hour, min} getRainStartTime()

Returns {hour, min}:

the sky weather raining start time.


setRainStopTime

Available since version: 0.1.10

This method will set the sky weather time when it stops raining/snowing.

void setRainStopTime(int hour, int min)

Parameters:

  • int hour: the sky weather raining stop hour.
  • int min: the sky weather raining stop min.

getRainStopTime

Available since version: 0.1.10

This method will get the sky weather time when it stops raining/snowing.

{hour, min} getRainStopTime()

Returns {hour, min}:

the sky weather raining stop time.


setFogColor

This method will set the sky fog color day variation.

void setFogColor(int id, int r, int g, int b)

Parameters:

  • int id: the id of fog color day variation.
  • int r: the red color component in RGB model.
  • int g: the green color component in RGB model.
  • int b: the blue color component in RGB model.

setCloudsColor

This method will set the sky clouds color.

void setCloudsColor(int r, int g, int b)

Parameters:

  • int r: the red color component in RGB model.
  • int g: the green color component in RGB model.
  • int b: the blue color component in RGB model.

setPlanetSize

This method will set the planet size ratio.

void setPlanetSize(int planetId, float size)

Parameters:

  • int planetId: the planet id, for more information see Planet constants.
  • float size: the size ratio.

setPlanetColor

This method will set the planet color.

void setPlanetColor(int planetId, int r, int g, int b, int a)

Parameters:

  • int planetId: the planet id, for more information see Planet constants.
  • int r: the red color component in RGBA model.
  • int g: the green color component in RGBA model.
  • int b: the blue color component in RGBA model.
  • int a: the alpha color component in RGBA model.

setPlanetTxt

Available since version: 0.3.0

This method will set the planet texture.

void setPlanetTxt(int planetId, string texture)

Parameters:

  • int planetId: the planet id, for more information see Planet constants.
  • string texture: name.

setLightingColor

This method will set the sky lighting color.

void setLightingColor(int r, int g, int b)

Parameters:

  • int r: the red color component in RGB model.
  • int g: the green color component in RGB model.
  • int b: the blue color component in RGB model.