#include <Scene.h>
Public Member Functions | |
| BengScene (void) | |
| ~BengScene (void) | |
| Removes the scene from the game, destroying any attached layers and any objects that might be contained in those layers. | |
| BengSystem * | getSystem (void) |
| Retrieves the BengSystem object that this scene is attached to, if any. | |
| void | attachToSystem (BengSystem *parentsystem) |
| const char * | getName (void) |
| void | setName (const char *name) |
| void | addLayer (BengLayer *layer) |
| void | clearLayers (void) |
| Marks all attached layers for deletion, and physically removes them after all layers have been processed, to avoid unsafe deletion. | |
| BengLayer * | getLayer (int layernum) |
| int | getNumLayers (void) |
| Retrieves the total number of attached layers in this scene, minus any layers that are marked for deletion. | |
| void | setMainLayer (int mainlayer) |
| void | setCameraPos (BengFixed xIn, BengFixed yIn) |
| void | getCameraPos (BengVector &out) |
| void | setCameraRegion (int xIn, int yIn, int wIn, int hIn) |
| void | getCameraRegion (int &xOut, int &yOut, int &wOut, int &hOut) |
| void | doCameraPons (void) |
| void | process (void) |
Friends | |
| class | BengLayer |
| class | BengObject |
| class | BengIGfx |
The BengSystem object will always have one "main" scene which is handled automatically and by default will cover up the entire screen. This means you can use this to switch dynamically between different maps without inducing any loading times (although the scene will need to have been loaded previously, an operation that will take up more memory).
| BengScene::BengScene | ( | void | ) |
Creates a BengScene object. It will be pretty useless in its initial state, as it initializes to nothingness. You will need to add layers and give the scene a name.
| BengScene::~BengScene | ( | void | ) |
Removes the scene from the game, destroying any attached layers and any objects that might be contained in those layers.
| void BengScene::addLayer | ( | BengLayer * | layer | ) |
Takes an instantiated BengLayer and attaches it to the scene, adding it to the internal layers list. For the rest of the layer's lifetime, it will be managed by the scene and will rely on it for safe deletion. The basic code for attaching a layer might look like:
BengLayer *layer = new BengLayer(32, 32);
layer->setTileSize(32, 32);
scene->addLayer(layer);
| void BengScene::attachToSystem | ( | BengSystem * | parentsystem | ) |
| void BengScene::clearLayers | ( | void | ) |
Marks all attached layers for deletion, and physically removes them after all layers have been processed, to avoid unsafe deletion.
| void BengScene::doCameraPons | ( | void | ) |
| void BengScene::getCameraPos | ( | BengVector & | out | ) |
| void BengScene::getCameraRegion | ( | int & | xOut, | |
| int & | yOut, | |||
| int & | wOut, | |||
| int & | hOut | |||
| ) |
| BengLayer* BengScene::getLayer | ( | int | layernum | ) |
Retrieves the attached BengLayer at index layernum. Keep in mind that this method will become unreliable if at any time you decide to delete any attached layers, because the indexes of the proceeding layers will change.
| const char* BengScene::getName | ( | void | ) |
Returns the name of this scene as previously set using setName(). The name can be seen in the standard output and logging, as well as user-defined areas such as for title cards.
| int BengScene::getNumLayers | ( | void | ) |
Retrieves the total number of attached layers in this scene, minus any layers that are marked for deletion.
| BengSystem* BengScene::getSystem | ( | void | ) |
Retrieves the BengSystem object that this scene is attached to, if any.
| void BengScene::process | ( | void | ) |
| void BengScene::setCameraRegion | ( | int | xIn, | |
| int | yIn, | |||
| int | wIn, | |||
| int | hIn | |||
| ) |
| void BengScene::setMainLayer | ( | int | mainlayer | ) |
| void BengScene::setName | ( | const char * | name | ) |
Sets the scene's name to the C string 'name'. The name can be seen in the standard output and logging, as well as user-defined areas such as for title cards.
friend class BengIGfx [friend] |
friend class BengLayer [friend] |
friend class BengObject [friend] |
1.5.8