Commit 16d612f2 authored by Michael Murtaugh's avatar Michael Murtaugh

centered text

parent e2ed54f7
......@@ -37,7 +37,9 @@ class RunText(SampleBase):
# len = graphics.DrawText(offscreen_canvas, font, pos, 20, textColor, my_text)
y = pos + line_height
for char in my_text:
graphics.DrawText(offscreen_canvas, font, self.args.margin, y, textColor, char)
cw = font.CharWidth(char)
cx = self.args.margin + ((offscreen_canvas.width - cw) / 2)
graphics.DrawText(offscreen_canvas, font, cx, y, textColor, char)
y += line_height
pos -= 1
if (pos + txtlen < 0):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment