I meant to add a bit more.  The clock.schedule call to the function
would call it every time the clock is ticked.  The schedule_interval
sets up a periodic call.  There is also clock.schedule_once which
would call the function just one time, after the interval.  Take a
look at the pyglet.clock module documentation in the API reference, it
was much more clear to me than the clock information in the
programming guide.

-price

On Nov 28, 4:50 pm, stampson <[EMAIL PROTECTED]> wrote:
> A few things...I think it's not hitting your check function because
> you never call clock.tick().  And then, you're using clock.schedule
> which takes only the function as an argument.  Try this:
>
> from pyglet import clock
> from pyglet import font
> from pyglet import window
>
> win = window.Window()
>
> ft = font.load('Arial',36)
>
> text = font.Text(ft,'Hello World')
>
> def check(dt):
>     print 'hi there'
>
> clock.schedule_interval(check,2.0)
>
> while not win.has_exit:
>     dt=clock.tick()
>     win.dispatch_events()
>     win.clear()
>     text.draw()
>     win.flip()
>
> On Nov 28, 4:17 pm, sol <[EMAIL PROTECTED]> wrote:
>
> > Do the clock.schedule and clock.schedule_once functions work on XP?
> > They do not seem to work for me. For example the following code never
> > seems to call my 'check' callback and therefore never prints  "HI
> > THERE":
>
> > from pyglet import clock
> > from pyglet import font
> > from pyglet import window
>
> > win = window.Window()
>
> > ft = font.load('Arial', 36)
> > text = font.Text(ft, 'Hello, World!')
>
> > def check(dt):
> >         print "HI THERE"
>
> > clock.schedule(check,2000)
>
> > while not win.has_exit:
> >     win.dispatch_events()
> >     win.clear()
> >     text.draw()
> >     win.flip()
>
> > Thanks in advance,
>
> > Sol
--~--~---------~--~----~------------~-------~--~----~
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