About Store Forum Documentation Contact



Post Reply 
GUI Skin
Author Message
Tottel Offline
Member

Post: #1
GUI Skin
Hi there!

I'm not sure how to do this best: I need to display many buttons on the screen with different images on them.

First of all, Button::setImage() doesn't seem to do anything.

So, I went on to Button::skin::button to set normal PanelImagePtr;
By default, skin is set to NULL. Should I create a new skin for every button? Should I set it to Gui.skin and reset after every draw?

However, if I want to set a PanelImagePtr, I need to create it with PanelImageParams. How exactly does this work? It crashes on the create when I use default Params.

Thanks!
02-11-2015 09:01 PM
Find all posts by this user Quote this message in a reply
Pherael Offline
Member

Post: #2
RE: GUI Skin
I have several buttons on screen created in code with different imges draw on them
Code:
button.image = UID(...);

and it's working without problem.

But I'm not sure if I understand your problem.
(This post was last modified: 02-11-2015 09:15 PM by Pherael.)
02-11-2015 09:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #3
RE: GUI Skin
Hi,

Button setImage works ok, make sure you're calling it after 'create' method.
this draws an image on top of the button, if you want it to replace the button you need to set EmptyGuiSkin as well as the skin.

Quote:However, if I want to set a PanelImagePtr, I need to create it with PanelImageParams. How exactly does this work? It crashes on the create when I use default Params.
You can create panel images in the editor for simplicity.
I don't know why you're getting a crash, perhaps the parameters are invalid, for example pointer members.
02-11-2015 09:34 PM
Find all posts by this user Quote this message in a reply
Post Reply