class
#include <Jazz2/Tiles/TileMap.h>
TileMap Represents a renderable tile map, consists of multiple layers.
Base classes
- class nCine::SceneNode
- Base class for the transformation nodes hierarchy.
Public types
- struct DestructibleDebris
- Describes a visual debris (particle effect)
- enum class DebrisFlags { None = 0x00, Disappear = 0x01, Bounce = 0x02, AdditiveBlending = 0x04 }
- Flags that modify behaviour of DestructibleDebris, supports a bitwise combination of its member values.
Public static variables
-
static std::
int32_t TriggerCount constexpr - Maximum number of triggers.
-
static std::
int32_t HardcodedOffset constexpr - Hardcoded offset for layer positioning.
Constructors, destructors, conversion operators
-
TileMap(StringView tileSetPath,
std::
uint16_t captionTileId, bool applyPalette) - ~TileMap()
Public functions
- auto IsValid() const -> bool
- void SetOwner(ITileMapOwner* owner)
- Sets an owner of tile map.
- auto GetSize() const -> Vector2i
- Returns size of tile map in tiles.
- auto GetLevelBounds() const -> Vector2i
- Returns size of tile map in pixels.
- auto GetPitType() const -> PitType
- Returns pit type.
- void SetPitType(PitType value)
- Sets pit type.
- void OnUpdate(float timeMult) override
- Called once every frame to update the node.
- void OnEndFrame()
- auto OnDraw(RenderQueue& renderQueue) -> bool override
- Renders the node.
-
auto IsTileEmpty(std::
int32_t tx, std:: int32_t ty) -> bool - Returns
true
if the mask of a tile on the main (sprite) layer is completely empty. - auto IsTileEmpty(const AABBf& aabb, TileCollisionParams& params) -> bool
- Returns
true
if the mask of tiles on the main (sprite) layer intersecting a given AABB is empty. - auto CanBeDestroyed(const AABBf& aabb, TileCollisionParams& params) -> bool
- Returns
true
if tiles on the main (sprite) layer intersecting a given AABB can be destroyed. - auto GetTileSuspendState(float x, float y) -> SuspendType
- Returns suspend state of a given position.
-
auto AdvanceDestructibleTileAnimation(std::
int32_t tx, std:: int32_t ty, std:: int32_t amount) -> bool - Advances descructible animation of a given tile.
-
void AddTileSet(StringView tileSetPath,
std::
uint16_t offset, std:: uint16_t count, const std:: uint8_t* paletteRemapping = nullptr) - Adds an additional tile set as a continuation of the previous one.
- void ReadLayerConfiguration(Stream& s)
- void ReadAnimatedTiles(Stream& s)
-
void SetTileEventFlags(std::
int32_t x, std:: int32_t y, EventType tileEvent, std:: uint8_t* tileParams) -
auto GetCaptionTile() const -> StaticArrayView<TileSet::
DefaultTileSize*TileSet:: DefaultTileSize, Color> - Returns a caption tile.
- void CreateDebris(const DestructibleDebris& debris)
- Creates a generic debris.
-
void CreateTileDebris(std::
int32_t tileId, std:: int32_t x, std:: int32_t y) - Creates a tile debris.
-
void CreateParticleDebris(const GraphicResource* res,
Vector3f pos,
Vector2f force,
std::
int32_t currentFrame, bool isFacingLeft) - Creates a particle debris from a sprite.
-
void CreateSpriteDebris(const GraphicResource* res,
Vector3f pos,
std::
int32_t count) - Creates a sprite debris.
-
auto GetTrigger(std::
uint8_t triggerId) -> bool - Returns state of a given trigger.
-
void SetTrigger(std::
uint8_t triggerId, bool newState) - Sets state of a given trigger.
- void InitializeFromStream(Stream& src)
- Initializes tile map state from a stream.
- void SerializeResumableToStream(Stream& dest)
- Serializes tile map state to a stream.
- void OnInitializeViewport()