item_image_button[]

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

item_image_button[]

by 0gb.us » Tue Dec 04, 2012 13:08

I'm trying to use item image buttons on a formspec, but it isn't working. There's no error, but there's also no image button. I'm using this format: "item_image_button[0,0;1,1;default:dirt;<name>;<label>]".

Am I doing this the wrong way, or is it an error in the game / API documentation?

I'm currently using a workaround involving image_button[] and minetest.inventorycube(), but it doesn't work well for stairs and slabs, because they are non-cubes. If I'm just doing it wrong, or it's an error in the documentation, what is the right way to add buttons representing items?

Thank you!
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Dec 04, 2012 14:34

item_image_button is only in 0.4.4-dev. Be sure to use this version of Minetest if testing the mod.
 

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

by 0gb.us » Tue Dec 04, 2012 14:53

So the manual is ahead of the current release then. That's a pleasant change from other software I've used, where the manual is several versions BEHIND the actual software.

Thank you for your time and quick response!
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Dec 04, 2012 17:33

The manual isnt ahead of the software. https://github.com/celeron55/minetest/blob/master/doc/lua_api.txt is the API of the current master branch of git; the latest version. If you are using 0.4.3 you should use this API specification: https://github.com/celeron55/minetest/blob/stable-0.4/doc/lua_api.txt (its from the 0.4-stable branch of git).
 

User avatar
0gb.us
Member
 
Posts: 841
Joined: Sun Sep 16, 2012 01:55

by 0gb.us » Tue Dec 04, 2012 19:08

Wow, a different manual, for a different version . That's even more organized. Thanks!

I must have ended up on the wrong one by mistake. I'll pay better attention next time, now that I know.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 8 guests

cron