On May 26, 2:51 pm, Jonathan Hartley <[email protected]> wrote: > I used Florian's code for this > previously, and one side-effect that I took a while to grok, but which > turned out to be handy, is that you can choose to get the text on a > bitmap which just has an alpha channel (no RG or B). This means that > when using that as a texture (eg. in a sprite) then the current > glColor value will be used to color the non-transparent text pixels. > So you can easily display the text bitmap in a color of your choosing.
That's just how pyglet handles glyphs. Tough I think it's a bad idea for the following reasons: 1) you can get the same coloring effect using an RGBA texture instead of a LUMINANCE texture, with the colors all dialed to white, and the alpha being the glyph 2) If you're putting it into a LUMINANCE texture, you can't use the same texture for other assets that do have color, hence forcing you to rebind a texture every time you want to draw a few quads of glyphs These days (in the halogen gui toolkit) I actually convert pyglets glyph information to RGBA in order to put it into the same texture atlas I use for 9-patch images that decorate my buttons/widgets etc., so that during the course of drawing the whole GUI, I never need to switch textures. -- 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.
