Kivy: canvas.before, canvas.after and canvas

So I have a fair amount of trouble wrapping my head around kivy. The docs aren't great, they're not bad, but it can be hard to find the exact information I'm looking for. So I decided that while I'm programming, I'll use my fairly defunct blog to document the stuff I wasn't able to find explained really easy.

First off, canvas. It took me a little while to figure this out, but as a canvas is an App based thing (not a Widget based thing, as I was expecting when I first started doing something with it), the developers of kivy gave you access to three different canvasses. They are all drawn after another. The first canvas to be drawn is canvas.before. After that, the "normal" canvas is drawn. Lastly, you get the content of canvas.after. Essentially, you have get three layers that you can use to draw upon!

Hope this helped someone! Drop me a note on Twitter if it does, it'll help me to write more.


Comments powered by Disqus