Suggestion: multiple buttons per skin?

mr.Zog

08-12-2007 17:02:33

Since I am also using quickGUI for my bachelor's thesis application, I am currently considered with the following situation:

(photoshop-concept)


As you can see, I got several types of buttons.
Currently this means for each button I need a new skin. (except for new, load and add - just using setText here...)
(and I guess I'll do it this way since time keeps running ^^ )
But for future projects I guess it could be helpful if you are able to create multiple button images for one skin?

kungfoomasta

08-12-2007 20:53:40

Its been brought up, and I would like to support it, but I can't think of a good way to do so. I will try to think of a good way in the background, while I work on current stuff.

One thing you could try:

Make a skin with the following extra images:

myskin.button.plus.png
myskin.button.plus.down.png
myskin.button.plus.over.png

myskin.button.minus.png
myskin.button.minus.down.png
myskin.button.minus.over.png

And in code:

myButton->setSkinComponent(".button.minus");

This should allow what you want.

mr.Zog

09-12-2007 16:08:12

I'll give it a try, thanks!


EDIT:
It works perfectly :)
In case anybody else needs this, you need a

saveButton->applyDefaultTexture();


after the saveButton->setSkinComponent(".button.minus");, otherwise the old texture gets displayed until you mouse-over the button.
(redraw didn't help)

kungfoomasta

10-12-2007 21:10:15

I will look into the redraw function when I get a chance, it would be more intuitive if it did update correctly.