Skip to content

Commit

Permalink
Adding replace for strings back into the FontLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
erodozer committed Jul 17, 2011
1 parent d8bcdc4 commit ec34d53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Rockmeter.py
Expand Up @@ -273,6 +273,7 @@ def __init__(self, stage, section, font):
self.text = "" #the text that will be rendered to screen
self.textexpr = self.getexpr("text", "''") #the text from the ini that will be evalutated
self.replace = "" #replace character a character in the string with this
self.replace = self.get("replace", "").split("_") #replace character a character in the string with this
self.alignment = halign(self.get("alignment", str, "LEFT"), 'left')
#alignment of the text
self.useComma = self.get("useComma", bool, False) #use commas when drawing numbers
Expand All @@ -289,6 +290,9 @@ def updateLayer(self, playerNum):
else:
text = str(text)

if self.replace.strip() is not "" or "None":
text.replace(self.replace[0], self.replace[1])

wid, hgt = self.font.getStringSize(str(text))

#needs to be done later because of values that may be dependant on the text's properties
Expand Down

0 comments on commit ec34d53

Please sign in to comment.