Annchienta::Map Class Reference
List of all members.
Detailed Description
A
Map is probably one of the most important classes in the engine. It holds a game map and everything in it. For an example map XML file, see
Example of a Map file
Constructor & Destructor Documentation
Annchienta::Map::Map |
( |
const char * |
fileName, |
|
|
bool |
scripts = true | |
|
) |
| | |
Load a new map.
- Parameters:
-
| fileName | XML file where the Map should be loaded from. |
| scripts | If the onload scripts should be executed. This also means all <if> tags will evaluate to true. |
Annchienta::Map::Map |
( |
int |
w, |
|
|
int |
h, |
|
|
const char * |
tileset | |
|
) |
| | |
Creates a new, empty Map.
- Parameters:
-
| w | The new map width. |
| h | The new map height. |
| tileset | Directory where the Map TileSet should be loaded from. |
Annchienta::Map::~Map |
( |
|
) |
|
Member Function Documentation
void Annchienta::Map::addNewLayer |
( |
int |
z = 0 |
) |
|
Adds a new, empty Layer to this Map.
- Parameters:
-
| z | Initial Z offset of the new Layer. |
void Annchienta::Map::depthSort |
( |
|
) |
|
void Annchienta::Map::draw |
( |
bool |
scripts = true |
) |
const |
Draws the Map to the screen.
- Parameters:
-
| scripts | If the onPreRender and onPostRender scripts should be executed. |
Layer* Annchienta::Map::getCurrentLayer |
( |
|
) |
const |
- Returns:
- A reference to the current Layer in this Map.
int Annchienta::Map::getCurrentLayerIndex |
( |
|
) |
const |
- Returns:
- The index of the current Layer.
const char* Annchienta::Map::getFileName |
( |
|
) |
const |
- Returns:
- The fileName from which this Map was loaded.
int Annchienta::Map::getHeight |
( |
|
) |
const |
- Returns:
- The height of this Map.
Layer* Annchienta::Map::getLayer |
( |
int |
index |
) |
const |
- Parameters:
-
| index | The index of Layer you want to retrieve. |
- Returns:
- A reference to the desired Layer.
int Annchienta::Map::getNumberOfLayers |
( |
|
) |
const |
- Returns:
- The number of layers in this Map.
StaticObject* Annchienta::Map::getObject |
( |
const char * |
name |
) |
|
Finds an object in this Map. This function starts searching in the current Layer, when not found in continues to search the other Layers.
- Parameters:
-
- Returns:
- The found object.
Person* Annchienta::Map::getPerson |
( |
const char * |
name |
) |
|
The same as getObject(), but returns a Person.
- Parameters:
-
| name | Name of the Person to be found. |
- Returns:
- The found person.
TileSet* Annchienta::Map::getTileSet |
( |
|
) |
const |
int Annchienta::Map::getWidth |
( |
|
) |
const |
- Returns:
- The width of this Map.
void Annchienta::Map::onPostRender |
( |
|
) |
const |
Executes onPostRender code. Automatically called by draw().
void Annchienta::Map::onPreRender |
( |
|
) |
const |
Executes onPreRender code. Automatically called by draw().
Removes an object from this Map. If you don't have a pointer to it, only the name, use getObject() first.
- Parameters:
-
void Annchienta::Map::setCurrentLayer |
( |
int |
index |
) |
|
Sets a new current Layer.
- Parameters:
-
| index | The index of the new current Layer. |
void Annchienta::Map::sortLayers |
( |
|
) |
|
Sorts Layers by their respective Z offset.
void Annchienta::Map::update |
( |
|
) |
|
Updates this Map, all Layers and all objects in those Layers.
Member Data Documentation