![]() |
Walls And Holes
1
|
Class to represent each tile on the tileMap. More...
#include <tile.h>
Public Slots | |
void | templateThicknessChanged () |
void | templatePositionChanged () |
Signals | |
void | tileChanged (int x, int y) |
void | tilePinged (int x, int y) |
Public Member Functions | |
Tile (TileTemplate *tileTemplate=nullptr, int xPos=-1, int yPos=-1, QObject *parent=nullptr) | |
bool | hasTileTemplate () const |
TileTemplate * | tileTemplate () const |
float | thickness () const |
float | height () const |
QVector2D | position () const |
float | relativeThickness () const |
float | relativeHeight () const |
QVector2D | relativePosition () const |
const TileMaterial * | topMaterial () const |
const TileMaterial * | sideMaterial () const |
float | setRelativeThickness (float relativeThickness) |
setRelativeThickness More... | |
void | setRelativeHeight (float relativeHeight) |
QVector2D | setRelativePosition (QVector2D relativePosition) |
void | resetTile (TileTemplate *newTileTemplate) |
Class to represent each tile on the tileMap.
|
explicit |
|
inline |
float Tile::height | ( | ) | const |
QVector2D Tile::position | ( | ) | const |
|
inline |
|
inline |
|
inline |
void Tile::resetTile | ( | TileTemplate * | newTileTemplate | ) |
Sets all relative values to zero, and changes the tileTemplate to newTileTemplate
void Tile::setRelativeHeight | ( | float | relativeHeight | ) |
QVector2D Tile::setRelativePosition | ( | QVector2D | relativePosition | ) |
float Tile::setRelativeThickness | ( | float | relativeThickness | ) |
setRelativeThickness
Tries to set the relative thickness of this tile. Will be clipped such that relativeThickness + template->thickness will be in (0, 1].
Will also ensure that the thickness doesn't cause the tile to go out of bounds due to the tiles grid position.
Becuase of these, the ultimate value set may differ from that passed, so this returns the value that gets set.
thickness |
const TileMaterial * Tile::sideMaterial | ( | ) | const |
|
inlineslot |
|
inlineslot |
float Tile::thickness | ( | ) | const |
|
signal |
|
signal |
|
inline |
const TileMaterial * Tile::topMaterial | ( | ) | const |