Created
June 24, 2014 06:12
-
-
Save Torxed/d4934d7941b417c4560b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Part of my main class more often than not, | |
# this will do the actual drawing of lines | |
def draw_line(xy, dxy, color=(0.2, 0.2, 0.2, 1)): | |
glColor4f(color[0], color[1], color[2], color[3]) | |
glBegin(GL_LINES) | |
glVertex2f(xy[0], xy[1]) | |
glVertex2f(dxy[0], dxy[1]) | |
glEnd() | |
# How to call it to get a two-line-thickness healthbar. | |
draw_line((x, y+height_offset), (x+(width * values['hp']), y+height), (0.2, 0.2, 1.0, 1)) | |
draw_line((x, y+height_offset+1), (x+(width * values['hp']), y+height+1), (1.0, 0.2, 0.2, 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment