(B+ GUI) Loading an Image into a button?
Blitz3D Forums/Blitz3D Beginners Area/(B+ GUI) Loading an Image into a button?
| ||
Is it possible to load a little image to put it into a button, if yes, how?(example please) if not how could I do it?(using panels?) but how to get the same color has the application itself? Thanks alot |
| ||
nope not with the default b+ commands you can however do something appropriate with a canvas: 1 make a canvas, of say 32x32 pixels 2 load a 32x32 buttonimage, and draw it on the canvas.. 3 use $201 to check on 'buttonclicks' a little more advanced, draw a 96x32 image of 3 button next to eachother in photoshop or something. These 3 buttons represent: 1 unactive (button and icon in grey) 2 mouse moving over (button grey, icon in color) 3 selected (button and icon in color) load this image as animimage, (or as normal image and use drawimagerect). When nothing happens, and when you start, you draw the left button on the canvas. When moving your mouse on it ($203), you draw the middle image on the canvas When you leave the canvas again ($206) you draw the left image again. When you click with the mouse on it ($201) you set it to active.. the right button (you have to store this state in a var.). The fun with canvasses is that you can also use the 2nd and 3rd mousebutton, and if you get a little more creative, you can make animating buttons when you move your mouse over it ($203). |
| ||
additionally, you can also use $205 when you enter a canvas .. this saves the cpu from drawing the image all over again, however, -call me sloppy- for a 32x32 image I don't care about that :) |
| ||
heh thanks |
| ||
You can of course just use a panel image. You can still detect clicks etc. Check for EventID()=$202 and EventSource() = panel. |