OpenMiner/docs/lua-api-sky.md

137 lines
1.7 KiB
Markdown
Raw Normal View History

# Lua API: Sky
## Example
```lua
mod:sky {
2020-03-12 13:48:11 +01:00
id = "sky_overworld", -- mandatory
color = {
day = {50, 153, 204},
},
fog_color = {
day = {50, 153, 204},
},
objects = {
sun = {
texture = "texture-sun",
size = 256,
},
moon = {
texture = "texture-moon_phases",
size = 256,
phases = {
count = 8,
size = 32
}
},
stars = {
count = 1000,
size = 4,
}
}
}
```
## Attributes
### `color`
Sky color.
Example:
```lua
color = {
day = {154, 50, 33}
}
```
Possible values:
- `day`: Sky color at midday
### `fog_color`
Fog color.
Example:
```lua
fog_color = {
day = {154, 50, 33}
}
```
Possible values:
- `day`: Fog color at midday
2020-03-12 13:48:11 +01:00
### `id`
ID of the sky. **Mandatory field.**
Example:
```lua
id = "sky_nether"
```
IDs are usually of the form `mod:sky` but the `mod:` prefix is prepended automatically so it's not needed.
### `objects`
#### `moon`
Moon attributes table. Example:
```lua
moon = {
texture = "texture-moon_phases"
size = 256,
phases = {
count = 8,
size = 32
}
},
```
Attributes:
- `texture`: texture to use (without texture, the moon will use this color: (240, 240, 240))
- `size`: size of the moon (default: `256`)
- `phases`
- `count`: amount of phases (default: `1`)
- `size`: size of the phase texture (default: `32`)
#### `sun`
Sun attribute table. Example:
```lua
sun = {
texture = "texture-sun",
size = 256,
},
```
Attributes:
- `texture`: texture to use (without texture, the sun will use this color: (255, 255, 0))
- `size`: size of the sun (default: `256`)
#### `stars`
Stars attribute table. Example:
```lua
stars = {
count = 1000,
size = 4,
}
```
Attributes:
- `count`: size of the sun (default: `1000`)
- `size`: size of the sun (default: `4`)