Created
December 11, 2017 11:49
-
-
Save buxx/8d97a4a740678d6e1dcb0f1f60410c64 to your computer and use it in GitHub Desktop.
testing_transparency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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