Help with formspecs

Post Reply
User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Help with formspecs

by MineYoshi » Post

I would like to get some help from you about coding Formspecs.
I would be very thankful if you could give some examples about launching a formspec with a craftitem, because i'm having some issues about figuring out how to do so.
Thanks.
Have a nice day! :D

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

http://dev.minetest.net/formspec#Examples

this should already help you a bit :D
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Help with formspecs

by rubenwardy » Post

also see https://rubenwardy.com/minetest_modding ... specs.html

Formspecs are a series of "elements" each element has a purpose, such as setting the size of a window or placing a GUI component such as a button.

Formspecs are rather disgusting and badly designed. They're fiddly to place, and they don't respond will to changing screen resolutions.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

rubenwardy wrote: Formspecs are rather disgusting and badly designed. They're fiddly to place, and they don't respond will to changing screen resolutions.
i couldn't agree more, they are hidous
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Help with formspecs

by MineYoshi » Post

How can i do something similar to "textarea", but without the option of text input. I just want a block showing up some text, with weight and height. I've tried "label", but it just makes the text go plain.
Have a nice day! :D

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Help with formspecs

by TumeniNodes » Post

anyone looked into adding support for svg for formspecs?
don't know if it would be viable or makes sense? : /
https://github.com/memononen/nanosvg

and requires this http://www.glfw.org/
A Wonderful World

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

for your text on cards:

Code: Select all

label[X,Y;label]
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

actually, have no idea how to do a multiline label. or yes i have an idea but it requires a real big work.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: Help with formspecs

by Nathan.S » Post

Multiline text is done with

Code: Select all

textarea[4.3,0;4,2;;Your text here, or variable;]'
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

thanks, but we talk about something that you can’t edit :)
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: Help with formspecs

by Nathan.S » Post

textarea isn't editable in the fashion I explained. I use it in my autostore mod: https://github.com/NathanSalapat/autost ... it.lua#L82
It pulls text from a field, hence the variable being used, but you could just as easily put in your own text directly. On the vending machine the text can't be changed once saved, it just displays, much like the text on the menu screens.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

oh, okay, sorry. But is it doable in CSM?
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: Help with formspecs

by Nathan.S » Post

I have no idea, I've never used any CSM yet.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

:D
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Re: Help with formspecs

by Tmanyo » Post

If you are looking to make scrollable paragraphs without needing to use a textarea which requires using arrow keys to go up and down, or without using a scrollbar element which is tricky to use for big bodies of text, you can use a textlist where commas act as newlines. The downside is that if you don't know the body of text and it happens to have a comma in it, it will send the rest of the text to the newline. Also, if you didn't know the text you would have to use a function to wrap the text to the next line after a certain amount of characters. That is achievable by using this function: My wrap text function. It would require minor touches such as replacing the \n with , so that it works for the form and replacing the core function name. On another note, some formspec elements in the API don't seem to work so are pretty much garbage kind of like the whole system.

A multiline label is also pretty simple from what I have done in the past.

Code: Select all

"label[X,Y;label text label text \n label text label text]"
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Help with formspecs

by azekill_DIABLO » Post

okay, cool thank you!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests