UI requests

Discussion of proposed new features.

UI requests

PostPosted by godan » 27 Sep 2016, 13:34

I've been using the native UI extensively recently, and I think it's great (despite the ongoing debate to replace it with a third party lib :)). However, there are some convenience functions that would be handy:

- Button::SetHoverColor(Color color) /Get
- Button::SetPressedColor(Color color) /Get
- Button::SetNormalColor(Color color) /Get

I have found that having to create separate images for the different button states, when all I need is a different color, adds quite a bit of work. And having these color properties wouldn't change the existing flow.

Then some more data in the UIEvents:

- Add DX,DY to OnResized (i.e. DX, DY is the difference in pixels from the old size to the new size). This will help with responsive layouts, I think.

In general, I think Urho should come with some higher level UI classes. ListView and ScrollView are really great. Along with this, a good Toolbar class would be nice (I need to write this so I will try to contribute this myself). For example, I wrote a PopUp class that has been a huge time saver: https://github.com/danhambleton/UrhoPopUp

Image
User avatar
godan
Active user
Active user
 
Posts: 122
Joined: 23 Sep 2014, 20:28

Re: UI requests

PostPosted by cadaver » 27 Sep 2016, 14:09

The colors certainly make sense (though will make Button attribute inspector even more cluttered; the UIElement attributes themselves are already quite horrible considering how many there are), as does the resize delta.

As for the higher level elements, get contributing ;)
User avatar
cadaver
Urho3D author
Urho3D author
 
Posts: 1802
Joined: 16 Jan 2014, 14:52
Location: Finland

Re: UI requests

PostPosted by 1vanK » 27 Sep 2016, 14:18

godan wrote:
- Button::SetHoverColor(Color color) /Get
- Button::SetPressedColor(Color color) /Get
- Button::SetNormalColor(Color color) /Get


I did smooth color transition between button states in my game https://github.com/1vanK/Soulmates/blob ... Button.cpp
I think it looks nicer than switching
User avatar
1vanK
Moderator
Moderator
 
Posts: 430
Joined: 26 Jun 2015, 19:16
Location: Internet

Re: UI requests

PostPosted by Lumak » 28 Sep 2016, 17:23

In some industries, they add sprites into a Multiple-image Network Graphics (MNG) file and transition between 4 states:
-normal
-pressed
-hover
-disabled

Which really simplifies creating 2D games or UI layouts.
Lumak
Have many posts
Have many posts
 
Posts: 425
Joined: 08 Jun 2015, 15:38

Re: UI requests

PostPosted by cadaver » 29 Sep 2016, 20:28

Delta parameters added for resize.
User avatar
cadaver
Urho3D author
Urho3D author
 
Posts: 1802
Joined: 16 Jan 2014, 14:52
Location: Finland


Return to Feature Request

Who is online

Users browsing this forum: No registered users and 0 guests

cron