Page 1 of 1

My idea for the UI API

PostPosted: Thu Jan 15, 2015 01:37
by Kenney
Here's a few simple function ideas that would greatly help in creating cool looking UI elements:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
add_image(name, x, y, w, h, src)
add_text(name, x, y, w, h, txt, font_properties)
add_item(name, x, y, w, h, item) -- renders Minetest item
change_property(name, [x/y/w/h/src], value)
on_click(name)

get_screen_width()
get_screen_height()


While these few functions might seem crude or simple, they would actually allow for really unique UI's like the one seen below (Voxus concept);

Image

Re: My idea for the UI API

PostPosted: Thu Jan 15, 2015 03:52
by Zeno

Re: My idea for the UI API

PostPosted: Thu Jan 15, 2015 07:25
by rubenwardy
A new UI system would need to consider client side and server side split, and allow client side prediction, and be able to draw custom objects.

Have you seen smartfs? It pretty much does what you ask. (It is a library for Minetest, written in Lua.)

Re: My idea for the UI API

PostPosted: Thu Jan 15, 2015 08:25
by Kenney
rubenwardy wrote:A new UI system would need to consider client side and server side split, and allow client side prediction, and be able to draw custom objects.

It would indeed!

rubenwardy wrote:Have you seen smartfs? It preety much does what you ask. (It is a library for Minetest, written in Lua.)

I have, but it does rely on formspecs which are my worst nightmare when creating an UI like this. Formspecs are great to create quick prototype menus, but once you want to go final you need pixel precision which formspec lacks on every level.

Re: My idea for the UI API

PostPosted: Thu Jan 15, 2015 08:32
by rubenwardy
Yeah, formspecs suck. The inventory grid method of placing is not good. As for pixel perfect, the UI dialogs need to scale correctly on larger screens and DPIs, so the pixels given would have to be scaled up to the screen's size.

Re: My idea for the UI API

PostPosted: Thu Jan 15, 2015 20:06
by Kenney
rubenwardy wrote:As for pixel perfect, the UI dialogs need to scale correctly on larger screens and DPIs, so the pixels given would have to be scaled up to the screen's size.

No problem if the scaling stays on a number dividable by two.