CheeseBoard
A library for use with the CheeseBoard Cheddar platform
GfxScene.cpp
1 #include "GfxScene.h"
2 
3 GfxScene::GfxScene()
4 {
5  for(uint8_t i=0; i<MaxItems; i++) {
6  _items[i] = NULL;
7  }
8 }
9 
10 bool GfxScene::add(GfxItem* item) {
11  uint8_t i;
12  for(i=0; i<MaxItems && _items[i] != NULL; i++) {;}
13  if (i<MaxItems) {
14  _items[i] = item;
15  return true;
16  } else {
17  return false;
18  }
19 }
20 
22  for(uint8_t i=0; i<MaxItems; i++) {
23  if (_items[i] != NULL) {
24  _items[i]->draw();
25  }
26  }
27 }
28 
bool add(GfxItem *item)
Definition: GfxScene.cpp:10
Definition: GfxItem.h:5
void draw()
Draws all items in a scene in order.
Definition: GfxScene.cpp:21
virtual void draw(uint16_t xOffset=0, uint16_t yOffset=0)=0