Skip to content

Commit

Permalink
Adds valignment as a parameter to drawImage.
Browse files Browse the repository at this point in the history
  • Loading branch information
erodozer committed Nov 24, 2010
1 parent 66c4da4 commit 479db52
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/GameEngine.py
Expand Up @@ -832,7 +832,7 @@ def drawStarScore(self, screenwidth, screenheight, xpos, ypos, stars, scale = No

def drawImage(self, image, scale = (1.0, -1.0), coord = (0, 0), rot = 0, \
color = (1,1,1,1), rect = (0,1,0,1), stretched = 0, fit = 0, \
alignment = 1):
alignment = 1, valignment = 1):
"""
Draws the image/surface to screen
Expand All @@ -855,6 +855,8 @@ def drawImage(self, image, scale = (1.0, -1.0), coord = (0, 0), rot = 0, \
on the top side (1), bottom side (2), or center point (any other value) of the image
@param alignment: Adjusts the texture so the coordinate for x-axis placement can either be
on the left side (0), center point (1), or right(2) side of the image
@param valignment: Adjusts the texture so the coordinate for y-axis placement can either be
on the bottom side (0), center point (1), or top(2) side of the image
"""

width, height = scale
Expand Down Expand Up @@ -882,6 +884,7 @@ def drawImage(self, image, scale = (1.0, -1.0), coord = (0, 0), rot = 0, \
image.setScale(width, height)
image.setPosition(x, y)
image.setAlignment(alignment)
image.setVAlignment(valignment)
image.setAngle(rot)
image.setColor(color)
image.draw()
Expand Down

0 comments on commit 479db52

Please sign in to comment.