mirror of
https://github.com/pybricks/pybricks-projects.git
synced 2026-09-15 19:14:13 +00:00
snippets/ev3/screen_basics: finish show_image todo
ev3.screen.show_image is implemented now
This commit is contained in:
@@ -42,16 +42,8 @@ wait(5000)
|
||||
|
||||
# IMAGES ######################################################################
|
||||
|
||||
# TODO: this needs to be implemented in the Image class
|
||||
def show_image(img):
|
||||
ev3.screen.clear()
|
||||
x = (ev3.screen.width - img.width) // 2
|
||||
y = (ev3.screen.height - img.height) // 2
|
||||
ev3.screen.draw_image(x, y, img)
|
||||
|
||||
|
||||
# Show an image
|
||||
show_image(ev3_img)
|
||||
ev3.screen.show_image(ev3_img)
|
||||
|
||||
# Wait some time too look at image
|
||||
wait(5000)
|
||||
|
||||
Reference in New Issue
Block a user