A component that represents one square in a tilemap. More...
#include <Tile.h>


Public Member Functions | |
| Tile (int x, int y, int w, int h, int id) | |
| Constructs a Tile. | |
| void | init () override |
| Initializes the tile by adding Transform and Sprite components to its entity. | |
| void | resizeTile (int w, int h, float scale=0.64f) |
| Resizes the tile's underlying components. | |
Public Member Functions inherited from Component | |
| virtual void | update () |
| Called once per frame. Contains the component's main logic. | |
| virtual void | reload () |
| Called to reset the component's state. | |
| virtual void | draw () |
| Called once per frame after update. Used for rendering. | |
Public Attributes | |
| Transform * | transform |
| Pointer to the tile's Transform component. | |
| Sprites * | sprite |
| Pointer to the tile's Sprite component. | |
| SDL_Rect | tileRect |
| The rectangle defining the tile's position and size. | |
| int | tileID |
| The identifier for the type of tile (e.g., wall, path). | |
| const char * | path |
| The file path to the tile's texture. | |
Public Attributes inherited from Component | |
| Entity * | entity |
| Pointer to the entity that owns this component. | |
A component that represents one square in a tilemap.
This is a convenience component that combines a Transform and a Sprite and holds data specific to its role in a map, like its ID.
Constructs a Tile.
| x | The grid x-coordinate. |
| y | The grid y-coordinate. |
| w | The width of the tile. |
| h | The height of the tile. |
| id | The tile's type ID. |

|
overridevirtual |
Resizes the tile's underlying components.
| w | The new width. |
| h | The new height. |
| scale | The new rendering scale. |
