A question about paintoval message to the lcd object

Dec 24, 2011 at 1:08am

A question about paintoval message to the lcd object

I was just watching a rather good video about the workings of the new dict object but was baffled by how the paintoval message worked. In particular, when multiple paintoval messages were sent with different values, why did a new oval not appear (and what if in fact you wanted multiple ovals?)

There’s clearly some hidden state being kept around so that the “old” oval is erased first. Where is that?


Dec 24, 2011 at 3:14am


Dec 24, 2011 at 9:22am

Duh….I missed that. But clearing the entire canvas every time is a very heavy handed mechanism which of course won’t work if you want multiple objects. I thought that there might have been some “sprite” stuff going on that was just being glossed over as the tutorial was really about dict.

But thanks for pointing out what was happening.

Dec 24, 2011 at 4:39pm

You’re right that sprites would be a good way to handle such drawing if you have many moving objects to draw. (However, the Jitter equivalent, jit.lcd, does not support sprites; there you have to keep track of objects on your own.)

Here’s a bit on sprites in lcd:


You must be logged in to reply to this topic.