Note: Visit our Get Started page for more information about installing MediaLib.
This tutorial was designed for Computer Science Students.
All of the examples in this tutorial can be downloaded from the Gallery.
We are going to learn:
Download MediaLib and the MediaLib Exercise 1 files from the Gallery.
Run the program in ex1.py. You will see a new window with a black background and two eyes displayed (which are eye.png and eye2.png in the same folder).
In the text output, you will see Click the left button on the mouse to continue. Left click in the window and you will see the eyes change their positions.
Click again and the eyes will move again. Click again and the window will disappear.
Have a look and understand the program in ex1.py
import
import medialib.py
so we can use the commands in that program, to draw on screen (for example).draw
wait_mouse_leftclick()
clear
all_done
See the documentation for more detailed information.
Modify the program in ex1.py as you like and run it to see what will happen:
draw()
functiondraw()
function (put the image file into the folder of ex1.py if you want to load your own image)clear()
functiondraw()
functionsclear()
, draw()
and wait_mouse_leftclick()
functions.