Mittwoch, 8. August 2012

meowBG going kivy

I'm on holiday right now, and the last days I've been diving into the kivy framework. Kivy looks very promising, especially with respect to its multi-platform support. There has even been a kivy app released on Apple's app store. Hacking for iPhone and iPad in pure python? Me gusta!

So, after I've become a little tired of how sluggish my dear meowBG looks in its wxPython based implementation, I'm now planning to move the graphics parts entirely to kivy.

I'm especially looking forward to making the checkers fly smoothly across the board - the part that made my brain hurt in wxPython. It may be my lack of knowledge of wxPython, but animating widgets in kivy is just a walk in the park. Kivy's approach to animations is interesting: You define the animation independently of the widget it is applied to, and just specify the attributes that the animation will change. For instance, changing the position with an animation could work like this:

animation = Animation(pos=(100, 100), duration=0.2)
animation.start(target_widget)

This would move the object behind target_widget to the position (100, 100) within a fifth of a second. And of course you could specify a callback function to be called when the animation has finished, by setting

         animation.on_complete = your_callback_func

1 Kommentar: