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:
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 medialib.pyso we can use the commands in that program, to draw on screen (for example).
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()function (put the image file into the folder of ex1.py if you want to load your own image)