VoxelEngine/doc/en/scripting/builtins/libgfx-weather.md
MihailRis b1e854a73c
Update 0.27 docs (#484)
* update doc/*/scripting/builtins/libinventory.md

* add doc/*/scripting/builtins/libgfx-weather.md

* update doc/*/scripting/builtins/libfile.md

* update doc/*/item-properties & update doc/*/scripting/builtins/libinventory.md

* add inventory.decrement docs

* update doc/*/scripting/builtins/libinventory.md
2025-03-16 20:10:41 +03:00

2.0 KiB

gfx.weather library

A library for managing audio/visual weather effects.

Weather settings:

Property Description Default
fall Precipitation (see table 2) {}
clouds Cloudiness [0.0, 1.0] 0.0
fog_opacity Maximum fog density [0.0, 1.0] 0.0
fog_dencity Fog density 1.0
fog_curve Fog curve 1.0
thunder_rate Thunder rate [0.0, 1.0] 0.0

Precipitation:

Property Description Default
texture Precipitation texture ""
noise Precipitation noise ""
vspeed Precipitation vertical speed 1.0
hspeed Maximum horizontal speed of precipitation 0.1
scale Precipitation UV scale 0.1
min_opacity Minimum alpha multiplier for precipitation 0.0
max_opacity Maximum alpha multiplier for precipitation 1.0
max_intensity Maximum precipitation intensity 1.0
opaque Disable precipitation translucency false
splash Precipitation splash particle settings table {}
-- Smoothly switches weather
gfx.weather.change(
    -- weather settings table
    weather: table,
    -- weather change duration in seconds
    time: number,
    -- weather preset name
    [optional] name: str
)

-- Returns weather preset name
gfx.weather.get_current() -> str

-- Returns a copy of the weather settings table
gfx.weather.get_current_data() -> table

-- Returns the current precipitation intensity
gfx.weather.get_fall_intensity() -> number

-- Checks if weather is currently switching
gfx.weather.is_transition() -> bool