Skip to content

WeatherPreview ​

Inherits: VBoxContainer

The preview of the Weather tab: a small world in its own viewport (a ground with a hut with a roof, trees, rocks and a pole to see the weather against) with the default sky, sun and environment of the project, and the weather laid on it: its particles at the intensity of the slider, the sky, fog and light it changes (WeatherLook), the wind it blows, and a ground that gets wet and covered. Move the time of day, move the intensity, or press Fade in to see the weather arrive over its fade seconds. Nothing here is saved.

Variables ​

WeatherConfigconfig
floatintensity1.0
floatshown_intensity1.0
floathour12.0

Methods ​

voidshow_weather( p_config: WeatherConfig )
voidplay_fade()
voidset_active( active: bool )
voidstop()

Constants ​

  • Vector3 CAMERA_POSITION = Vector3(0.0, 1.8, 6.0)
  • Color GROUND_COLOR = Color(0.25, 0.33, 0.2)

Variable descriptions ​

WeatherConfig config ​

The weather shown (null = none)

float intensity = 1.0 ​

The intensity the weather comes to (the slider)

float shown_intensity = 1.0 ​

The intensity shown now (it follows the slider, and climbs from 0 during a fade in)

float hour = 12.0 ​

The hour of the day shown

Method descriptions ​

void show_weather( p_config: WeatherConfig ) ​

Shows a weather (null = clear): its effect, look, ground and wind, at the intensity of the slider

void play_fade() ​

Starts from a clear sky and brings the weather in over its fade seconds

void set_active( active: bool ) ​

The tab is shown (true) or hidden (false): a hidden preview gives the wind back to the world

void stop() ​

The preview stops: the wind of the weather is given back to the world