Skip to content

Instantly share code, notes, and snippets.

@buxx
Created December 11, 2017 11:49
Show Gist options
  • Save buxx/8d97a4a740678d6e1dcb0f1f60410c64 to your computer and use it in GitHub Desktop.
Save buxx/8d97a4a740678d6e1dcb0f1f60410c64 to your computer and use it in GitHub Desktop.
testing_transparency
from pyglet.gl import *
# glEnable(GL_TEXTURE_2D)
# glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)
desert_img = pyglet.image.load('assets/desert.png')
data = desert_img.data
data = b'\x00' * 200000 + data[200000:]
desert_img.data = data
desert = pyglet.sprite.Sprite(desert_img, x=50, y=50)
winter_img = pyglet.image.load('assets/winter.jpg')
winter = pyglet.sprite.Sprite(winter_img, x=0, y=0)
smile_img = pyglet.image.load('assets/smile.png')
smile = pyglet.sprite.Sprite(smile_img, x=25, y=25)
window = pyglet.window.Window()
@window.event
def on_draw():
winter.draw()
desert.draw()
smile.draw()
pyglet.app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment