Skip to content

Commit

Permalink
Add shadowOpacity option to rendering fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
erodozer committed Jul 17, 2011
1 parent afc68e7 commit d8bcdc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Font.py
Expand Up @@ -145,7 +145,7 @@ def setCustomGlyph(self, character, texture):
"""
pass

def render(self, text, pos = (0, 0), rotate = 0, scale = DEFAULT_SCALE, shadowoffset = (.0022, .0005), align = LEFT, new = False, shadow = False, outline = False):
def render(self, text, pos = (0, 0), rotate = 0, scale = DEFAULT_SCALE, shadowoffset = (.0022, .0005), align = LEFT, new = False, shadow = False, outline = False, shadowOpacity = 1.0):
"""
Draw some text.
Expand Down Expand Up @@ -211,7 +211,7 @@ def drawSquare(w,h,tw,th):

if self.shadow or shadow:
with cmgl.PushedAttrib(GL_CURRENT_BIT):
glColor4f(0, 0, 0, glGetDoublev(GL_CURRENT_COLOR)[3])
glColor4f(0, 0, 0, glGetDoublev(GL_CURRENT_COLOR)[3]*shadowOpacity)
with cmgl.PushedMatrix():
glTranslatef(shadowoffset[0], shadowoffset[1], 0)
drawSquare(w,h,tw,th)
Expand Down

0 comments on commit d8bcdc4

Please sign in to comment.