@@ -154,6 +154,14 @@ unsigned int Font::getSize()
void Font::start()
{
GP_ASSERT(_batch);
+
+ // Update the projection matrix for our batch to match the current viewport
+ const Rectangle& vp = Game::getInstance()->getViewport();
+ Game* game = Game::getInstance();
+ Matrix projectionMatrix;
+ Matrix::createOrthographicOffCenter(vp.x, vp.width, vp.height, vp.y, 0, 1, &projectionMatrix);
+ _batch->setProjectionMatrix(projectionMatrix);
_batch->start();
}
@@ -488,16 +488,6 @@ void Theme::setProjectionMatrix(const Matrix& matrix)
GP_ASSERT(_spriteBatch);
_spriteBatch->setProjectionMatrix(matrix);
-
- // Set the matrix on each Font used by the style.
- std::set<Font*>::const_iterator it;
- for (it = _fonts.begin(); it != _fonts.end(); ++it)
- {
- Font* font = *it;
- GP_ASSERT(font);
- GP_ASSERT(font->getSpriteBatch());
- font->getSpriteBatch()->setProjectionMatrix(matrix);
- }
SpriteBatch* Theme::getSpriteBatch() const