I actually tried that trick to reduce CPU usage ages ago but couldn't make it work. Apparently you can only do that if you aren't using ANY of the gfx.drawsomething; as soon as you draw one thing, it blanks the canvas.
The CPU usage is probably because each button is calling gfx.arc about 200 times to fill in the middle. I think I've come up with a more efficient algorithm, but I'll add your "do we need to redraw yet?" code as well.
Edit: The arc function isn't accurate enough to draw these buttons nicely, and it just gets worse when I try to do it more efficiently. I might go with a different shape for the buttons altogether.
I've also added a center button for any menu you want to put it on, just by holding the left button in the middle like you do with the rest of them. That'll be in the same update as the CPU stuff once I sort that out.
Last edited by Lokasenna; 01-20-2017 at 10:34 PM.
|