Hello,

I've been tinkering with pyglet to create interactive vector graphics
and I've run into some things that I don't understand.

As an experiment, I wrote some code that is supposed to create a
square that will follow your cursor. The code can be found here:
http://dl.dropbox.com/u/19756079/Experiment1.py
http://dl.dropbox.com/u/19756079/Experiment2.py

I managed to get some results with my first experiment, using the @
method. However, since I didn't fully understand how the @ method
works, I attempted to recreate the experiment in a way that I saw in a
lot of other example code.

The code in experiment2 is what came out of that endeavor. But, I
still don't understand the flow of the code, how my on_draw function
is being called, or how to redraw the square as the mouse coordinates
change.

So if you were to look at the code in Experiment2, what would be the
best way to get the square to follow your cursor (without the use of
the @ notation) ? I was thinking about placing an on_mouse_motion()
function within my Screen class and somehow having that update, but
I'm not sure how that would work.

I'm still trying to learn how to set up an optimal loop that can
handle events, update physics (if I had any), and redraw objects. If
anyone has some pointers, comments about how wrong my code is, or
reference material, it would help me a lot.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to