About Store Forum Documentation Contact



Post Reply 
[SOLVED] Different kind of buttons
Author Message
Dwight Offline
Member

Post: #1
[SOLVED] Different kind of buttons
Provided the following image for the Chat : http://puu.sh/l5qb2/da5a003298.jpg

On the right side of the chat-window, there are 4 buttons with 2 states (Active, Passive; bool). With the current GUI system, I find it hard to get different kind of buttons to work in the same GUI Skin (e.g impossible, as there's only 1 button type).

As a workaround (or perhaps intended), I am creating different GUI Skin sets which only have this certain type of button, and overwrite the default GUI Skin with this new one within the interface. Basically, there are currently 6 GUI skins to get the complete interface to work.

Is there any performance downside to this method of working with UI elements? Or should I implement the GUI in some different way? Using different images as overlays is not an option, as the shape of the element is different.

[ Perhaps the GUI Skin-set could be extended to allow for adding multiple elements of the same element, and add a dropbox to the standard elements to choose which type you want to use. For example : click on a plus-button to add another button-style to the GUI Skin, and once clicked on the button on the GUI Element, a dropbox shows "Standard" or "Chat_World" or something similar when creating the interface. ]
(This post was last modified: 11-02-2015 08:21 PM by Dwight.)
11-01-2015 02:00 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Different kind of buttons
There's no performance penalty for having multiple gui skins, it's completely fine to do.

For the buttons that have the same background, but just different image on top, you can set the overlay using Button.image / Button.setImage
I'm doing this way for Esenthel Editor.
https://github.com/Esenthel/EsenthelEngi...Button.cpp
11-01-2015 10:10 PM
Find all posts by this user Quote this message in a reply
Post Reply