2

i executed the following code

def draw():
    screen.draw.text("hello", topleft=(10 , 10))

but the output I get is just 5 white blocks instead of hello enter image description here

Rabbid76
  • 202,892
  • 27
  • 131
  • 174
Tathagat
  • 23
  • 3

1 Answers1

2

The minimal Pygame Zero script looks as follows:

import pgzrun

def draw():
    screen.clear()
    screen.draw.text("hello", topleft = (10, 10))

pgzrun.go()

You have to call pgzrun.go() after the definition of the draw function.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174