On 19/08/11 20:08, Paul wrote:
> import pyglet
> from pyglet.gl import *
>
> ---CODE---
>
> window = pyglet.window.Window(500, 500)
>
> glEnable(GL_BLEND)
> glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
>
> animation = pyglet.image.load_animation('animation.gif')
> sprite = pyglet.sprite.Sprite(animation)
> map = pyglet.image.load('map.png')
>
> @window.event
> def on_draw():
> window.clear()
> map.blit(0, 0)
> sprite.set_position(sprite.x, sprite.y)
> sprite.draw()
> def update(dt):
> sprite.x += dt * 22
> sprite.y = 117
> pyglet.clock.schedule_interval(update, 1/60.)
> pyglet.app.run()
>
> ---CODE---
> ok, so this works(gives no errors), but the gif has a white
> background? even though i made it transparent in gimp.
> plz help???
> thank you very much for your time
>
I think you'll find that gif doesn't support transparency
http://en.wikipedia.org/wiki/Gif maybe you should save your images as
pngs instead; as you mention you're using the gimp that should be trivial.
HTH,
Adam.
--
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.