Richard Jones' Log: Something I'm working on...

Thu, 13 Aug 2009
with gui.canvas(background='antigravity.png') as canvas:
    with canvas.image('smiley.png', x=0, y=20):
        def animate(image):
            while image.x < 200:
                dt = yield
                image.x += 20*dt
        def on_mouse(image, mouse):
            print 'Got me!'

Screen capture at 10 frames per second; original animation runs smoother.

Comic fragment taken from XKCD #353 "Python". Smiley is all original art ;)

Comment by André Roberge on Thu, 13 Aug 2009

Stop teasing and share the code!!!

Please :-)

Very nice work, as usual.

Comment by lucio on Thu, 13 Aug 2009

Id like to see something like this for cocos2d. Does it make it easier? sounds really interesting.

Comment by Donn on Thu, 13 Aug 2009

Hi - I like the brevity of your API.

I have been toying with a Python 2D animation API using pycairo frame-based animation. I have not seen that "with" statement before and I should look into it.
If you want to grab some ideas or steal some code, please have a look.
My project is at: http://otherwise.relics.co.za/wiki/Software/Things/

Comment by Donn on Thu, 13 Aug 2009

Er... just to say, my last post's link gets a BR tag added and so does not go to the right place.

Comment by Richard Jones on Thu, 13 Aug 2009

I will be spending a large chunk of this extended weekend rewriting and refactoring the core. After that I'll look into releasing the code.

Comment by Pete Hunt on Fri, 14 Aug 2009

This looks very cool. I could definitely see combining this plus py2js to create a cross-platform (Tkinter and AJAX) GUI library