#include "Level.h"
#include "Game.h"
+#include "Text.h"
#include "fns.h"
#include <GL/gl.h>
#include <algorithm>
/** Draw Sprites*/
DrawSprites();
+ DrawText();
+
/** Draw Boundary Data */
DrawCollisions();
}
}
+void Level::DrawText()
+{
+ for (vector<Text*>::iterator i = mText.begin(); i != mText.end(); ++i) {
+ (*i)->draw();
+ }
+}
+
void Level::DrawCollisions()
{
if(Game::game()->ShowCollisions) {
}
}
}
+
+void Level::addText(Text* t) {
+ mText.push_back(t);
+}
using std::vector;
using std::string;
+class Text;
+
/**
This is a stand alone Level that will have varying jobs
Sprite* findSpriteByName(string name);/**< returns the first Sprite with a given name \param name Name of the sprite to return \return Pointer to the requested sprite */
bool Loaded;/**< Shows if the level has loaded or not (level changing) */
void Unload();/**< What should be done when this level is left (not deleted) */
- Font* getFont( int s, FontType t);/**< Grabs the font if it exists and creates it if it does not */
void closeFont(Font *);/**< Closes the font if not more texts are using it. */
+ /**
+ Add a Text object to be drawn on the screen
+ */
+ void addText(Text*);
+
protected://allow inheritance
string mName;
Background* mBackground;/**< Pointer to the current Background. */
vector<WorldObject*> mWorldObjects;/**< Vector of all objects on the level. \todo make a list ordered by Zorder (for drawing)*/
vector<Sprite*> mSprites;/**< Vector of all sprites on the level */
+ vector<Text*> mText; /**< Text objects to be displayed */
map<string,Actor> mActors;/**< This level's actors. */
vector<Animation> mAnims;/**< This level's Animations */
map<string, Texture> mTextures;/**< Textures that have been loaded by the level. */
void DrawIMG(SDL_Surface *img, int x, int y, int w, int h, int x2, int y2);/**< Draws an image at the specified location (x,y) that is blitted with width w and height h from the point (x2,y2) of the given image */
void DrawSprites();/**< Draws all Sprites. */
void DrawCollisions();/**< Draws all Collision data */
+
+ /**
+ Draws all Text elements on the screen.
+ */
+ void DrawText();
+
Behavior mLoadBehavior;/**< will be used to define the Load action of the level */
Behavior mUpdateBehavior;/**< will be used to define the update action of the level */
Behavior mUnloadBehavior;/**< will be used to define the end action of the level as it closes*/