* Draws all the digits in the number. */
| 247 | * Draws all the digits in the number. |
| 248 | */ |
| 249 | void NumberText::draw() |
| 250 | { |
| 251 | Surface::draw(); |
| 252 | std::ostringstream ss; |
| 253 | ss << _value; |
| 254 | std::string s = ss.str(); |
| 255 | int x = 0; |
| 256 | for (std::string::iterator i = s.begin(); i != s.end(); ++i) |
| 257 | { |
| 258 | _chars[*i - '0']->setX(x); |
| 259 | _chars[*i - '0']->setY(0); |
| 260 | _chars[*i - '0']->blit(this); |
| 261 | x += _chars[*i - '0']->getWidth() + 1; |
| 262 | } |
| 263 | |
| 264 | this->offset(_color); |
| 265 | } |
| 266 | |
| 267 | } |