Skip to main content

draw_text_center()

Description#

Draws text to the center of the screen

Syntax#

draw_text_center(string, font_size=16)
draw_text_center(string)
draw_text_center(string, font_size)

Parameters#

string\ font_size

Returns#

None

Example Code#
Python#
#Python code
from zumi.util.screen import Screen
import time
screen=Screen()
screen.draw_text_center('hello',font_size=10)
time.sleep(0.5)
screen.draw_text_center('hello',font_size=20)
time.sleep(0.5)
screen.draw_text_center('hello',font_size=30)
time.sleep(0.5)
screen.draw_text_center('hello',font_size=40)
time.sleep(0.5)
screen.draw_text_center('hello',font_size=50)
time.sleep(0.5)