#include <tb_tile_system.hpp>
Public Member Functions | |
| TileSystem (void) | |
| virtual | ~TileSystem (void) |
| void | ClearMap (void) |
| String | GetMapPropertyAsString (const String &propertyName) const |
| int | GetMapPropertyAsInteger (const String &propertyName) const |
| bool | GetMapPropertyAsBoolean (const String &propertyName) const |
| void | SetPropertiesForMap (const tbCore::DynamicStructure &mapProperties) |
| void | AddTileSet (const String &tilesetName, const tbGraphics::SpriteMap &spriteMap, const tbCore::DynamicStructure &tileSetProperties=tbCore::DynamicStructure::kNullValue) |
| AboutTileContainer | FindTilesWithProperty (const String &tileProperty, bool onlyVisibleLayers=false) const |
| AboutTileContainer | FindTilesWithPropertyEquals (const String &tileProperty, bool propertyValue, bool onlyVisibleLayers=false) const |
| AboutTileContainer | FindTilesWithPropertyEquals (const String &tileProperty, int propertyValue, bool onlyVisibleLayers=false) const |
| AboutTileContainer | FindTilesWithPropertyEquals (const String &tileProperty, const String &propertyValue, bool onlyVisibleLayers=false) const |
| void | SetPropertiesForTile (const String &tileSetName, const TileIndex &tileIndex, const tbCore::DynamicStructure &tileProperties) |
| String | GetTilePropertyAsString (const String &tileSetName, const TileIndex &tileIndex, const String &propertyName) const |
| int | GetTilePropertyAsInteger (const String &tileSetName, const TileIndex &tileIndex, const String &propertyName) const |
| bool | GetTilePropertyAsBoolean (const String &tileSetName, const TileIndex &tileIndex, const String &propertyName) const |
| void | SetTileProperty (const String &tileSetName, const TileIndex &tileIndex, const String &propertyName, const String &propertyValue) |
| void | SetTileProperty (const String &tileSetName, const TileIndex &tileIndex, const String &propertyName, const int propertyValue) |
| void | SetTileProperty (const String &tileSetName, const TileIndex &tileIndex, const String &propertyName, const bool propertyValue) |
| void | AddTileLayer (const String &tileLayerName, const std::vector< TileIndex > &tileData, const String &tileSetName, const TileLocation &columnCount, const TileLocation &rowCount) |
| void | AddTileLayer (const String &tileLayerName, const std::vector< TileIndex > &tileData, const std::vector< TileSetIndex > &tileSetData, const TileLocation &columnCount, const TileLocation &rowCount) |
| void | SetLayerVisible (const String &tileLayerName, const bool isVisible) |
| void | SetTile (const String &tileLayerName, const TileLocation &tileColumn, const TileLocation &tileRow, const TileIndex &toTileIndex, const TileSetIndex &toTileSetIndex=kInvalidTileSetIndex) |
| bool | MoveEntity (const tbMath::Vector2 ¤tPosition, tbMath::Vector2 &finalPosition, const TurtleBrains::Math::Unstable::BoundingVolume &boundingVolume) const |
| bool | MoveEntity (Entity &entity, const tbMath::Vector2 &fromOldPosition, const tbMath::Vector2 &toNewPosition) const |
| bool | IsPointInSolid (const tbMath::Vector2 &pointPosition) const |
| void | UpdateColliderInformation (void) |
Public Member Functions inherited from TurtleBrains::Graphics::Graphic | |
| Graphic (void) | |
| Graphic (const Graphic &other)=default | |
| virtual | ~Graphic (void)=default |
| Graphic & | operator= (const Graphic &other)=default |
| bool | IsActive (void) const |
| void | SetActive (const bool isActive) |
| void | Update (const float deltaTime) |
| bool | IsVisible (void) const |
| void | SetVisible (const bool isVisible) |
| void | Render (void) const |
| const tbMath::Vector2 & | GetPosition (void) const |
| void | SetPosition (const float x, const float y) |
| void | SetPosition (const tbMath::Vector2 &position) |
| const tbMath::Vector2 & | GetOrigin (void) const |
| void | SetOrigin (const AnchorLocation &anchor, const float offsetX, const float offsetY) |
| void | SetOrigin (const AnchorLocation &anchor, const tbMath::Vector2 &offset=tbMath::Vector2::Zero()) |
| void | SetOrigin (const float originX, const float originY) |
| void | SetOrigin (const tbMath::Vector2 &origin) |
| float | GetDepth (void) const |
| void | SetDepth (const float newDepth) |
| const tbMath::Vector2 & | GetScale (void) const |
| void | SetScale (const float scale) |
| void | SetScale (const tbMath::Vector2 &scale) |
| void | SetScale (const float scaleX, const float scaleY) |
| tbMath::Angle | GetRotation (void) const |
| void | SetRotation (const tbMath::Angle &angle) |
| void | SetScroll (const float scroll) |
| void | SetScroll (const float scrollX, const float scrollY) |
| bool | IsRelative (void) const |
| const Color & | GetColor (void) const |
| virtual void | SetColor (const tbGraphics::Color &newColor) |
| virtual PixelSpace | GetPixelWidth (void) const |
| virtual PixelSpace | GetPixelHeight (void) const |
| float | GetWidth (void) const |
| float | GetHeight (void) const |
| float | GetScaledWidth (void) const |
| float | GetScaledHeight (void) const |
| tbMath::Vector2 | GetAnchorPosition (const tbGraphics::AnchorLocation &anchor, const float offsetX, const float offsetY) const |
| tbMath::Vector2 | GetAnchorPosition (const tbGraphics::AnchorLocation &anchor, const tbMath::Vector2 &offset=tbMath::Vector2::Zero()) const |
| bool | UnstableIsPointContained (const tbMath::Vector2 &point) const |
Protected Member Functions | |
| virtual void | OnRender (void) const override |
Protected Member Functions inherited from TurtleBrains::Graphics::Graphic | |
| virtual void | OnUpdate (const float deltaTime) |
| virtual void | ApplyTransform (void) const |
| virtual void | PopTransform (void) const |
The TileSystem contains details about all the different tiles used as well as stores multiple tile layers to be rendered. Loads tile maps edited with Tiled when saved in the json format, although only basic support will be added in this first version.
The TileSystem has a lot of components working together, Tiles, TileSets and TileLayers it is important to understand the differences between each of these objects, particularly between TileSets and TileLayers. Each Tile
| TurtleBrains::Game::TileSystem::TileSystem | ( | void | ) |
Constructs an empty TileSystem with no tilesets, no tiles and no layers.
|
virtual |
Destroys the TileSystem object which will clean up all resources for each of the layers and tilesets.
| void TurtleBrains::Game::TileSystem::AddTileLayer | ( | const String & | tileLayerName, |
| const std::vector< TileIndex > & | tileData, | ||
| const std::vector< TileSetIndex > & | tileSetData, | ||
| const TileLocation & | columnCount, | ||
| const TileLocation & | rowCount | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::AddTileLayer | ( | const String & | tileLayerName, |
| const std::vector< TileIndex > & | tileData, | ||
| const String & | tileSetName, | ||
| const TileLocation & | columnCount, | ||
| const TileLocation & | rowCount | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::AddTileSet | ( | const String & | tilesetName, |
| const tbGraphics::SpriteMap & | spriteMap, | ||
| const tbCore::DynamicStructure & | tileSetProperties = tbCore::DynamicStructure::kNullValue |
||
| ) |
Adds a tileset with a given name to the TileSystem.
| void TurtleBrains::Game::TileSystem::ClearMap | ( | void | ) |
Clean up all resources for each of the layers and tilesets, will contain no tilesets, layers or tiles after this is complete.
| AboutTileContainer TurtleBrains::Game::TileSystem::FindTilesWithProperty | ( | const String & | tileProperty, |
| bool | onlyVisibleLayers = false |
||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| AboutTileContainer TurtleBrains::Game::TileSystem::FindTilesWithPropertyEquals | ( | const String & | tileProperty, |
| bool | propertyValue, | ||
| bool | onlyVisibleLayers = false |
||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| AboutTileContainer TurtleBrains::Game::TileSystem::FindTilesWithPropertyEquals | ( | const String & | tileProperty, |
| const String & | propertyValue, | ||
| bool | onlyVisibleLayers = false |
||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| AboutTileContainer TurtleBrains::Game::TileSystem::FindTilesWithPropertyEquals | ( | const String & | tileProperty, |
| int | propertyValue, | ||
| bool | onlyVisibleLayers = false |
||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| bool TurtleBrains::Game::TileSystem::GetMapPropertyAsBoolean | ( | const String & | propertyName | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| int TurtleBrains::Game::TileSystem::GetMapPropertyAsInteger | ( | const String & | propertyName | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| String TurtleBrains::Game::TileSystem::GetMapPropertyAsString | ( | const String & | propertyName | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| bool TurtleBrains::Game::TileSystem::GetTilePropertyAsBoolean | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const String & | propertyName | ||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| int TurtleBrains::Game::TileSystem::GetTilePropertyAsInteger | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const String & | propertyName | ||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| String TurtleBrains::Game::TileSystem::GetTilePropertyAsString | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const String & | propertyName | ||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| bool TurtleBrains::Game::TileSystem::IsPointInSolid | ( | const tbMath::Vector2 & | pointPosition | ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| bool TurtleBrains::Game::TileSystem::MoveEntity | ( | const tbMath::Vector2 & | currentPosition, |
| tbMath::Vector2 & | finalPosition, | ||
| const TurtleBrains::Math::Unstable::BoundingVolume & | boundingVolume | ||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| bool TurtleBrains::Game::TileSystem::MoveEntity | ( | Entity & | entity, |
| const tbMath::Vector2 & | fromOldPosition, | ||
| const tbMath::Vector2 & | toNewPosition | ||
| ) | const |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
|
overrideprotectedvirtual |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
Implements TurtleBrains::Graphics::Graphic.
| void TurtleBrains::Game::TileSystem::SetLayerVisible | ( | const String & | tileLayerName, |
| const bool | isVisible | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::SetPropertiesForMap | ( | const tbCore::DynamicStructure & | mapProperties | ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::SetPropertiesForTile | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const tbCore::DynamicStructure & | tileProperties | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::SetTile | ( | const String & | tileLayerName, |
| const TileLocation & | tileColumn, | ||
| const TileLocation & | tileRow, | ||
| const TileIndex & | toTileIndex, | ||
| const TileSetIndex & | toTileSetIndex = kInvalidTileSetIndex |
||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::SetTileProperty | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const String & | propertyName, | ||
| const bool | propertyValue | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::SetTileProperty | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const String & | propertyName, | ||
| const int | propertyValue | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::SetTileProperty | ( | const String & | tileSetName, |
| const TileIndex & | tileIndex, | ||
| const String & | propertyName, | ||
| const String & | propertyValue | ||
| ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.
| void TurtleBrains::Game::TileSystem::UpdateColliderInformation | ( | void | ) |
TODO: TurtleBrains: Documentation: Teach the user how to use this.