Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
Loading...
Searching...
No Matches
Tile Struct Reference

#include <definitions.hpp>

Public Member Functions

 Tile (Vector2 gridPosition, Rect sourceRect={{0, 0}, {64, 64}}, Color modulate=Color::WHITE)
 
template<class Archive >
void save (Archive &ar) const
 
template<class Archive >
void load (Archive &ar)
 

Public Attributes

Vector2 gridPosition
 
Rect sourceRect
 
Color modulate
 

Detailed Description

Tile

The tile class defines the position of the tile on the Tilemap grid, the sourceRect of the texture atlas and the modulate Color of the Tile.

Example usage:

// Create a tile at the gridPosition of `{-1, 0}`.
Tile myTile = Tile(Vector2{-1.0f, 0.0f}, Rect{Vector2{0.0f, 0.0f}, Vector2{64.0f, 64.0f}}, Color::RED);
static const Color RED
Definition definitions.hpp:60
Definition definitions.hpp:294
Definition definitions.hpp:509
Definition definitions.hpp:77

Constructor & Destructor Documentation

◆ Tile()

Tile::Tile ( Vector2  gridPosition,
Rect  sourceRect = {{0, 0}, {64, 64}},
Color  modulate = Color::WHITE 
)
inline

Member Function Documentation

◆ load()

template<class Archive >
void Tile::load ( Archive &  ar)
inline

◆ save()

template<class Archive >
void Tile::save ( Archive &  ar) const
inline

Member Data Documentation

◆ gridPosition

Vector2 Tile::gridPosition

◆ modulate

Color Tile::modulate

◆ sourceRect

Rect Tile::sourceRect

The documentation for this struct was generated from the following file: