Basic animation in Python - how to

  • Thread starter http://members.lycos.co.uk/dariusjack/
  • Start date
H

http://members.lycos.co.uk/dariusjack/

I need to draw a shaded rectangle and have flashing (gif animated)
points on it
so not to refresh all objects a rectangle, but points, changing their
colors, attributes.
Please refer me to some basic Python code for animation like that .

Darius
 
P

Peter Wang

I need to draw a shaded rectangle and have flashing (gif animated)
points on it
so not to refresh all objects a rectangle, but points, changing their
colors, attributes.
Please refer me to some basic Python code for animation like that .

Darius

What kind of graphical environment and operating system do you want to
do this on? Is there a particular UI toolkit you have in mind? Or do
you want to output an animated gif or small movie file?


-Peter
 
D

Donn Ingle

Please refer me to some basic Python code for animation like that .
You are in for a wild ride! Depending on your platform you can use dozens of
different tools. Try wxPython, pyCairo, pyGTK and PIL (Python Imaging
Library) for the most capable.

Basically you are looking at a fairly complex thing - you need to create
a "context" and then draw into it with commands (they vary according to
your toolkit) and then display the result. Loop that and change the drawing
every time and you have animation.

wxPython has very easy widgets for doing something like this (you can use an
animated gif for example), and it's cross-platform so that a big plus. It's
tricky to get into, but well worth it.

hth
\d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top