21 #ifndef GF_TILE_LAYER_H 22 #define GF_TILE_LAYER_H 27 #include "Portability.h" 29 #include "Transformable.h" 30 #include "VertexArray.h" 31 #include "VertexBuffer.h" 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 69 static constexpr
int NoTile = -1;
93 return m_tiles.getSize();
113 void setTexture(
const Texture& texture);
136 return m_texture !=
nullptr;
154 void setTilesetTileSize(
Vector2i tileSize);
163 return m_tilesetTileSize;
173 setMargin({ margin, margin });
201 setSpacing({ spacing, spacing });
253 void setTileSize(
Vector2i tileSize);
282 int getTile(
Vector2i position)
const;
312 RectF getLocalBounds()
const;
324 void setAnchor(
Anchor anchor);
346 void updateGeometry();
368 #ifndef DOXYGEN_SHOULD_SKIP_THIS 373 #endif // GF_TILE_LAYER_H
Vector2i getTileSize() const
Get the tile size.
Definition: TileLayer.h:261
A set of primitives.
Definition: VertexArray.h:65
bool hasTexture() const
Check if a texture is set.
Definition: TileLayer.h:135
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:73
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
Vector2i getMargin() const
Get the margin of the tileset.
Definition: TileLayer.h:190
Data in the graphics memory.
Definition: VertexBuffer.h:77
StaggerAxis
Stagger axis in a staggered or hexagonal map.
Definition: Stagger.h:48
Type
The type of tile layer.
Definition: TileLayer.h:74
A texture for colored images.
Definition: Texture.h:301
void setMargin(int margin)
Set the margin of the tileset.
Definition: TileLayer.h:172
Vector2i getMapSize() const
Get the size of the layer.
Definition: TileLayer.h:92
The namespace for gf classes.
Definition: Action.h:35
const Texture & getTexture() const
Get the source texture of the tileset.
Definition: TileLayer.h:124
Vector2i getOffset() const
Get the offset of the tileset.
Definition: TileLayer.h:236
void setSpacing(int spacing)
Set the spacing of the tileset.
Definition: TileLayer.h:200
A tile layer.
Definition: TileLayer.h:64
A staggered tile layer.
Definition: TileLayer.h:76
constexpr ArrayRef< T > array(const T *data, std::size_t size)
Create a constant reference to an array.
Definition: ArrayRef.h:203
Anchor
An anchor of a box.
Definition: Anchor.h:38
Vector2i getSpacing() const
Get the spacing of the tileset.
Definition: TileLayer.h:218
Vector2i getTilesetTileSize() const
Get the tile size in the tileset.
Definition: TileLayer.h:162
StaggerIndex
Stagger index in a staggered or hexagonal map.
Definition: Stagger.h:37
An orthogonal tile layer.
Definition: TileLayer.h:75
An orthogonal orientation.