Help with Formspec

Post Reply
User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Help with Formspec

by 1faco » Post

Hi all, actually i'm working on a mod that allows you to increase your stats through SP (skill points) that you obtain leveling up. i have the most of code, but i have no idea about how to do a formspec, i was trying https://luk3yx.gitlab.io/minetest-formspec-editor/ and i got this.

Image

This is the code generated

Code: Select all

formspec_version[4]
size[9,11]
label[1,2.6;Healt:]
label[1,3.6;Breath:]
label[1,4.6;Velocity:]
label[1,5.6;Jump:]
button_exit[3,9;3,1;;Close]
button[3,2.2;1,0.6;add1;+]
button[3,3.2;1,0.6;add2;+]
button[3,4.2;1,0.6;add3;+]
button[3,5.2;1,0.6;add4;+]
label[5,2.6;Hunger:]
label[5,3.6;Stamina:]
label[5,4.6;Luck:]
label[5,5.6;Exp:]
button[7,2.2;1,0.6;add5;+]
button[7,3.2;1,0.6;add6;+]
button[7,4.2;1,0.6;add7;+]
button[7,5.2;1,0.6;add8;+]
label[2.2,0.9;LVL:]
label[2.4,1.6;1]
label[6.2,0.9;SP:]
label[6.4,1.6;0]
label[1,7.2;Exp points:]
label[5,7.2;Next level:]
label[1,7.9;0]
label[5,7.9;0]
I need to know:
1- what is the right way to show this window to a player? Thanks to rubenwardy's modding book.
2- how to call functions by clicking a button.
3- how to show info at formspec (like actual level, exp remaining to next level, available skill points..).



Basically, i need to know how to connect the GUI with the code.

I found all information at rubenwardy's modding book, thanks u so much rubenwardy.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests