Created
November 18, 2018 08:08
-
-
Save codehearts/69162414fff28b29e984fde8b3905dde to your computer and use it in GitHub Desktop.
Function to draw a rectangle using Pyglet
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
import pyglet | |
def draw_rect(x, y, width, height): | |
pyglet.graphics.draw(4, pyglet.gl.GL_QUADS, | |
('v2f', [x, y, x + width, y, x + width, y + height, x, y + height])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
made this, inspired by above code.