Transparent buttons?
BlitzMax Forums/MaxGUI Module/Transparent buttons?
| ||
Hello, what's the best way to make transparent buttons so that the background picture of a panel is shown through the buttons? Is this possible with standard buttons? I'm new to BlitzMax; please include code example. Thanks! |
| ||
With standard buttons it would probably look quite ugly. The way to go is to use another panel as a button. You can switch on the sensitivity and get mouse and key events. Too late for today to put an example together, sorry, maybe tomorrow. With panels you can do quite a lot, I coded some SmartButtons in the past: http://jsp.logiczone.de/downloads/SmartButtonDemo1.2.zip |
| ||
Can't you set the alpha of an individual button? By setting the gadget alpha? I have no experience with BlitzGui tho, I use ifsogui. |
| ||
Here is a little example created quite quickly, but hope it helps to get the idea. |
| ||
Thanks jsp! I'm still having some trouble adding text into these panelgadgets. If I add label that's size is same as the panel's size everything is ok, except that I can center the text only horizontally with label's LABEL_CENTER. If the size of the label isn't same as the panelgadget's, there is something wrong with the picture. I also tried to use SetGadgetAlpha in order to make a standard button transparent, but at least in my system that didn't work. The example code below show's the details: |
| ||
Labels never center vertically, but horizontally only. The wrong display of the label is because of the missing manifest. Add: Import MaxGUI.XPManifest to use the standard manifest delivered with MaxGUI or take your own. SetGadgetAlpha does not work really well, it's not cross platform and also switched off when a canvas is used. Actually I don't use it at all. If I remember correctly it was used for window gadgets. |
| ||
Thanks! Now the labels look correct. |