Public Member Functions | |
| bool | Init (IND_Render *pRender) |
| void | End () |
| bool | Add (IND_Entity2d *pNewEntity2d) |
| bool | Add (int pLayer, IND_Entity2d *pNewEntity2d) |
| bool | Delete (IND_Entity2d *pEn) |
| void | RenderEntities2d () |
| void | RenderEntities2d (int pLayer) |
| void | RenderCollisionAreas (byte pR, byte pG, byte pB, byte pA) |
| void | RenderCollisionAreas (int pLayer, byte pR, byte pG, byte pB, byte pA) |
| void | RenderGridAreas (byte pR, byte pG, byte pB, byte pA) |
| void | RenderGridAreas (int pLayer, byte pR, byte pG, byte pB, byte pA) |
| bool | IsCollision (IND_Entity2d *pEn1, char *pId1, IND_Entity2d *pEn2, char *pId2) |
Other uses of this class:
| bool IND_Entity2dManager::Init | ( | IND_Render * | pRender | ) |
Parameters:
This function returns 1(true) if the manager is initialized satisfactorily. It must be called before using any method.
| void IND_Entity2dManager::End | ( | ) |
Operation:
This function frees the manager and all the objects that it contains.
| bool IND_Entity2dManager::Add | ( | IND_Entity2d * | pNewEntity2d | ) |
Parameters:
This function returns 1 (true) if the entity object passed as parameter exists and is added to the manager successfully.
This method is equivalent to add the entity to layer number 0.
| bool IND_Entity2dManager::Add | ( | int | pLayer, | |
| IND_Entity2d * | pNewEntity2d | |||
| ) |
Parameters:
This function returns 1 (true) if the entity object passed as parameter exists and is added to the manager successfully in a concrete layer.
Layers are useful for having graphical objects in different levels. For example, you can have a terrain with buildings, trees, etc; all in the same layer, and to have the score and gui buttons in a different layer that will be blitted always upon the terrain. In this case, the terrain an all the objects on it could be in Layer[0]. The buttons and score could be in an higher layer, for example Layer[1].
The z values of the objects (see SetPosition()) will be taken in count only between objects of the same layer.
There are 64 different layers allowed (0 - 63).
| bool IND_Entity2dManager::Delete | ( | IND_Entity2d * | pEn | ) |
Parameters:
This function returns 1(true) if the entity object passed as parameter exists and is deleted from the manager successfully.
| void IND_Entity2dManager::RenderEntities2d | ( | ) | [inline] |
Operation:
This function renders (draws on the screen) all the entities of the manager.
This method is equivalent to render the entities of layer number 0.
| void IND_Entity2dManager::RenderEntities2d | ( | int | pLayer | ) | [inline] |
Operation:
This function renders (draws on the screen) all the entities of the manager of a concrete layer.
| void IND_Entity2dManager::RenderCollisionAreas | ( | byte | pR, | |
| byte | pG, | |||
| byte | pB, | |||
| byte | pA | |||
| ) | [inline] |
Operation:
This function renders (blits on the screen) all the collision areas of the entities. It's good to use this method in order to check that our collision areas are accurate.
This method is equivalent to render the collision areas of layer number 0.
| void IND_Entity2dManager::RenderCollisionAreas | ( | int | pLayer, | |
| byte | pR, | |||
| byte | pG, | |||
| byte | pB, | |||
| byte | pA | |||
| ) | [inline] |
Operation:
This function renders (blits on the screen) all the collision areas of the entities of a certain layer. It's good to use this method in order to check that our collision areas are accurate.
| void IND_Entity2dManager::RenderGridAreas | ( | byte | pR, | |
| byte | pG, | |||
| byte | pB, | |||
| byte | pA | |||
| ) | [inline] |
Operation:
This function renders (blits on the screen) all the grid areas of the entities.
This method is equivalent to render the grid areas of layer number 0.
| void IND_Entity2dManager::RenderGridAreas | ( | int | pLayer, | |
| byte | pR, | |||
| byte | pG, | |||
| byte | pB, | |||
| byte | pA | |||
| ) | [inline] |
Operation:
This function renders (blits on the screen) all the grid areas of the entities of a certain layer.
| bool IND_Entity2dManager::IsCollision | ( | IND_Entity2d * | pEn1, | |
| char * | pId1, | |||
| IND_Entity2d * | pEn2, | |||
| char * | pId2 | |||
| ) | [inline] |
Parameters:
This function checks if two entities have collided in any of their bounding areas. Returns 1 if there is a collision. The id is a string of characters that identifies a collision group. For creating the bounding areas and defining collision groups you can use the following methods:
Important: This function only works with surfaces or animation entities.
Rotations allowed of the object: only in the z axis. Scaling allowed of the object: yes.
Use IND_Entity2d::ShowCollisionAreas() method in order to show or hide the collision areas of an entity. In order to render all the collision areas you should use the IND_Entity2dManager::RenderCollisionAreas() method.
1.5.4