I just realised I understand even less than I thought I did.

The 'glColor3f(1.0, 0.0, 0.0)' in 'on_draw()', four lines from the
bottom of that linked to code snippet. Modifying it demonstrates that
it controls the color of the texture that then gets blitted to the
screen. How the heck does that work? Surely the color of the pixels in
the texture are already set long before 'on_draw()' gets invoked?


On Nov 19, 7:38 pm, Jonathan Hartley <[email protected]> wrote:
> Hi all.
>
> I'm trying to convert convert a Label into an Image, to use as a
> sprite image.
>
> I'm trying out some code I found posted by pyalot, here on this 
> list:http://groups.google.com/group/pyglet-users/browse_thread/thread/b6c0...
>
> My problem is that the text always comes out black (rather than the
> Label.__init__() 'color' param.)
> Alex suggests in that post that this can be fixed by changing the
> texture creation format from GL_RGBA to GL_ALPHA, but this doesn't
> seem to fix the problem for me - even though pyalot reported it worked
> for them.
>
> Has anyone got any clues for how I might fix this? Thanks!
>
> The reason I'm doing this is that I want the text on screen to slowly
> fade away. It will be used as floaty 'points scored' visual feedback
> in the game. I plan to achieve this using the sprite.opacity property.
> I was previously doing it by simply using a Label on screen, and
> modifying its color every frame to make it gradually more transparent.
> But as has been discussed elsewhere on this list, this causes a lot of
> work to be done under the covers, and it wasn't fast enough when there
> were lots of them on screen. If there are better approaches than the
> one I'm trying above, I'd be all ears. Thanks.

--

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].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=.


Reply via email to