* Creates a FPS counter of the specified size. * @param width Width in pixels. * @param height Height in pixels. * @param x X position in pixels. * @param y Y position in pixels. */
| 36 | * @param y Y position in pixels. |
| 37 | */ |
| 38 | FpsCounter::FpsCounter(int width, int height, int x, int y) : Surface(width, height, x, y), _frames(0) |
| 39 | { |
| 40 | _visible = Options::fpsCounter; |
| 41 | |
| 42 | _timer = new Timer(1000); |
| 43 | _timer->onTimer((SurfaceHandler)&FpsCounter::update); |
| 44 | _timer->start(); |
| 45 | |
| 46 | _text = new NumberText(width, height, x, y); |
| 47 | setColor(Palette::blockOffset(15)+12); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Deletes FPS counter content. |