forked from VoxeLibre/VoxeLibre
some things
This commit is contained in:
parent
558df5e4bd
commit
54b119cffa
|
@ -1,19 +1,22 @@
|
||||||
Formspecs are an important part of game and mod development.
|
# MineClone2 Formspec Guide
|
||||||
|
|
||||||
This guide will learn you rules about creation of formspecs for the MineClone2 game.
|
***This guide will learn you rules about creation of formspecs for the MineClone2 game.***
|
||||||
|
|
||||||
|
Formspecs are an important part of game and mod development.
|
||||||
|
|
||||||
First of all, MineClone2 aims to support ONLY last formspec version. Many utility functions will not work with formspec v1 or v2.
|
First of all, MineClone2 aims to support ONLY last formspec version. Many utility functions will not work with formspec v1 or v2.
|
||||||
|
|
||||||
Label font size should be 25 to be minecraft like. We arent modifying formspec prepend in order to not break existing mods.
|
Label font size should be 25 to be minecraft like. We arent modifying formspec prepend in order to not break existing mods.
|
||||||
|
|
||||||
Just use this code to apply it to your formspec:
|
Just add this code to apply it to your formspec:
|
||||||
```lua
|
```lua
|
||||||
"style_type[label;font_size=25]",
|
mcl_formspec.apply_label_size
|
||||||
```
|
```
|
||||||
|
|
||||||
The typical width of an inventory formspec is `0.375 + 9 + ((9-1) * 0.25) + 0.375 = 11.75`
|
The typical width of an 9 slots width inventory formspec is `0.375 + 9 + ((9-1) * 0.25) + 0.375 = 11.75`
|
||||||
|
|
||||||
Margins is 0.375
|
Margins is 0.375
|
||||||
|
|
||||||
Space between 1st inventory line and the rest of inventory is 0.45
|
Space between 1st inventory line and the rest of inventory is 0.45
|
||||||
|
|
||||||
Labels should have 0.375 space above if there is no other stuff above and 0.45 between content
|
Labels should have 0.375 space above if there is no other stuff above and 0.45 between content
|
||||||
|
|
|
@ -13,16 +13,16 @@ end
|
||||||
|
|
||||||
local mcl_hoppers_formspec = table.concat({
|
local mcl_hoppers_formspec = table.concat({
|
||||||
"size[9,7]",
|
"size[9,7]",
|
||||||
"label[2,0;" .. F(C("#313131", S("Hopper"))) .. "]",
|
"label[2,0;"..F(C(mcl_formspec.label_color, S("Hopper"))).."]",
|
||||||
"list[context;main;2,0.5;5,1;]",
|
"list[context;main;2,0.5;5,1;]",
|
||||||
mcl_formspec.get_itemslot_bg(2,0.5,5,1),
|
mcl_formspec.get_itemslot_bg(2,0.5,5,1),
|
||||||
"label[0,2;" .. F(C("#313131", S("Inventory"))) .. "]",
|
"label[0,2;"..F(C(mcl_formspec.label_color, S("Inventory"))).."]",
|
||||||
"list[current_player;main;0,2.5;9,3;9]",
|
"list[current_player;main;0,2.5;9,3;9]",
|
||||||
mcl_formspec.get_itemslot_bg(0,2.5,9,3),
|
mcl_formspec.get_itemslot_bg(0,2.5,9,3),
|
||||||
"list[current_player;main;0,5.74;9,1;]",
|
"list[current_player;main;0,5.74;9,1;]",
|
||||||
mcl_formspec.get_itemslot_bg(0,5.74,9,1),
|
mcl_formspec.get_itemslot_bg(0,5.74,9,1),
|
||||||
"listring[context;main]",
|
"listring[context;main]",
|
||||||
"listring[current_player;main]",
|
"listring[current_player;main]"
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Downwards hopper (base definition)
|
-- Downwards hopper (base definition)
|
||||||
|
|
Loading…
Reference in New Issue