Are you using a Sprite to draw the image?  If you already have a PNG
that has transparent portion, something like this will work:

import pyglet

win = pyglet.window.Window(500, 500)
batch = pyglet.graphics.Batch()

img = pyglet.resource.image('someimagewithalpha.png')

sprite = pyglet.sprite.Sprite(img, x= 200, y = 200, batch = batch)

@win.event
def on_draw():
        win.clear()
        batch.draw()

pyglet.app.run()

On Aug 29, 11:20 am, amigojapan <[email protected]> wrote:
> I have tried this
>     from pyglet.gl import *
>     glEnable(GL_BLEND)
>     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
> and then draw an image that is partly transparent in .png
> but the transparent part appears red.
>
> also I have tried
>     import pyglet
>     pyglet.gl.glClearColor(0, 0, 1, 1)
>
> and then drew an image that is partly transparent in .gif
> and the transparent part appears like partly pink...
>
> any ideas as to what I am doing wrong?
>
> do you need to see the whole program I am talking about?

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to