Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onShow() {
- redraw = true;
- }
- function onUpdate(dc) {
- dc.clearClip();
- redraw = true;
- fullUpdate();
- partialUpdate();
- draw(dc);
- }
- function onPartialUpdate(dc) {
- partialUpdate();
- dc.setClip(clipMin[0], clipMin[1], clipMax[0] - clipMin[0], clipMax[1] - clipMin[1]);
- draw(dc);
- }
- function draw(dc) {
- if (redraw) {
- // Full redraw, 1x per minute (or when he is looking on his watch)
- var dc2 = backgroundBitmap.getDc();
- dc2.draw(...)
- redraw = false;
- }
- dc.drawBitmap(0, 0, backgroundBitmap);
- // Second hand, drawn every second
- dc.draw(...)
- }
Add Comment
Please, Sign In to add comment