My idea for the UI API

User avatar
Kenney
Member
 
Posts: 131
Joined: Fri Jan 02, 2015 12:12
In-game: Kenney

My idea for the UI API

by Kenney » Thu Jan 15, 2015 01:37

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
Games:
Voxus | UFO Race
 

Zeno
Member
 
Posts: 140
Joined: Sun Jun 29, 2014 03:36
GitHub: Zeno-

Re: My idea for the UI API

by Zeno » Thu Jan 15, 2015 03:52

 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: My idea for the UI API

by rubenwardy » Thu Jan 15, 2015 07:25

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.)
Last edited by rubenwardy on Thu Jan 15, 2015 11:31, edited 1 time in total.
 

User avatar
Kenney
Member
 
Posts: 131
Joined: Fri Jan 02, 2015 12:12
In-game: Kenney

Re: My idea for the UI API

by Kenney » Thu Jan 15, 2015 08:25

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.
Games:
Voxus | UFO Race
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: My idea for the UI API

by rubenwardy » Thu Jan 15, 2015 08:32

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.
 

User avatar
Kenney
Member
 
Posts: 131
Joined: Fri Jan 02, 2015 12:12
In-game: Kenney

Re: My idea for the UI API

by Kenney » Thu Jan 15, 2015 20:06

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.
Games:
Voxus | UFO Race
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 15 guests

cron