On Apr 27, 6:56 pm, edexter <[email protected]> wrote: > where do I look if I want to replace the graphics ie. the .png picture > with a square exc... ??? I want to try to make some changes to be > able change the color exc. exc. I have one in pycap that I want to > port over.. I was thinking of calling it a toggle.
I wouldn't really call this version 'production ready', so you may want to hold off on using it too much. It was mostly an attempt to iron on the major bugs, such as this mouse coordinates one. To answer your question, to keep things simple for the download, I'm mostly just using untextured quads for what you're seeing, so you won't find an external image file. Without going into too many details, and if I understand what you are looking for, use the widget's setTexture function. It would look something like: widget = CheckBox((0.1, 0.15), (0.1, 0.025), text = 'Check Box') widget.setTexture(fileName) ... where fileName is the location of the image file. There are also two additional, optional parameters for the function - color and idx. color is the color you want to use for the texture (defaults to the pygag-defined color value WHITE (1.0, 1.0, 1.0, 1.0)). idx is the index in the list of textures for the widget you want to set (defaults to 0). idx allows you to have multiple textures for the widget, if desired. However, if you just want to change the color, without using a texture, just use the setColor function. The first parameter is the color you want. The second, optional parameter is idx, which works like the setTexture parameter. For a list of predefined colors, look at the colors.py file in the utilities folder. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
