| 25 | void Ticker::eventOccured(Event *e) { Control::eventOccured(e); } |
| 26 | |
| 27 | void Ticker::onRender() |
| 28 | { |
| 29 | Control::onRender(); |
| 30 | |
| 31 | int xpos; |
| 32 | int ypos; |
| 33 | if (!animating) |
| 34 | { |
| 35 | xpos = align(TextHAlign, Size.x, font->getFontWidth(text)); |
| 36 | ypos = 0; |
| 37 | |
| 38 | auto textImage = font->getString(text); |
| 39 | fw().renderer->draw(textImage, Vec2<float>{xpos, ypos}); |
| 40 | } |
| 41 | else |
| 42 | { |
| 43 | UString out = text; |
| 44 | xpos = align(TextHAlign, Size.x, font->getFontWidth(out)); |
| 45 | ypos = 0 - animTimer / 4; |
| 46 | auto outImage = font->getString(out); |
| 47 | fw().renderer->draw(outImage, Vec2<float>{xpos, ypos}); |
| 48 | |
| 49 | if (!messages.empty()) |
| 50 | { |
| 51 | UString in = messages.front(); |
| 52 | xpos = align(TextHAlign, Size.x, font->getFontWidth(in)); |
| 53 | ypos = 15 - animTimer / 4; |
| 54 | auto inImage = font->getString(in); |
| 55 | fw().renderer->draw(inImage, Vec2<float>{xpos, ypos}); |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void Ticker::update() |
| 61 | { |
nothing calls this directly
no test coverage detected