21 #ifndef GF_TILE_LAYER_H 22 #define GF_TILE_LAYER_H 26 #include "Portability.h" 29 #include "TileTypes.h" 30 #include "Transformable.h" 31 #include "VertexArray.h" 32 #include "VertexBuffer.h" 35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 70 static constexpr
int NoTile = -1;
91 return m_tiles.getSize();
112 m_tileset.setTexture(texture);
125 return m_tileset.getTexture();
136 return m_tileset.hasTexture();
147 m_tileset.unsetTexture();
157 m_tileset.setTileSize(tileSize);
167 return m_tileset.getTileSize();
177 m_tileset.setMargin(margin);
187 m_tileset.setMargin(margin);
197 return m_tileset.getMargin();
207 m_tileset.setSpacing(spacing);
217 m_tileset.setSpacing(spacing);
227 return m_tileset.getSpacing();
237 m_tileset.setOffset(offset);
247 return m_tileset.getOffset();
263 void setTileSize(
Vector2i tileSize);
292 int getTile(
Vector2i position)
const;
322 RectF getLocalBounds()
const;
334 void setAnchor(
Anchor anchor);
356 void updateGeometry();
374 #ifndef DOXYGEN_SHOULD_SKIP_THIS 379 #endif // GF_TILE_LAYER_H
Vector2i getTileSize() const
Get the tile size.
Definition: TileLayer.h:271
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:90
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:196
void setTilesetTileSize(Vector2i tileSize)
Set the tile size in the tileset.
Definition: TileLayer.h:156
Data in the graphics memory.
Definition: VertexBuffer.h:77
A tileset.
Definition: Tileset.h:39
Orientation orientation(float angle)
Get an orientation from an angle.
A texture for colored images.
Definition: Texture.h:309
void setSpacing(Vector2i spacing)
Set the spacing of the tileset.
Definition: TileLayer.h:216
void setMargin(int margin)
Set the margin of the tileset.
Definition: TileLayer.h:176
void setMargin(Vector2i margin)
Set the margin of the tileset.
Definition: TileLayer.h:186
Vector2i getMapSize() const
Get the size of the layer.
Definition: TileLayer.h:90
void setOffset(Vector2i offset)
Set the offset of the tileset.
Definition: TileLayer.h:236
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:246
MapCellIndex
Map cell index in a map celled or hexagonal map.
Definition: MapCell.h:35
void setSpacing(int spacing)
Set the spacing of the tileset.
Definition: TileLayer.h:206
A tile layer.
Definition: TileLayer.h:65
void unsetTexture()
Unset the source texture of the tile layer.
Definition: TileLayer.h:146
constexpr ArrayRef< T > array(const T *data, std::size_t size)
Create a constant reference to an array.
Definition: ArrayRef.h:204
Anchor
An anchor of a box.
Definition: Anchor.h:38
Vector2i getSpacing() const
Get the spacing of the tileset.
Definition: TileLayer.h:226
Vector2i getTilesetTileSize() const
Get the tile size in the tileset.
Definition: TileLayer.h:166
void setTexture(const Texture &texture)
Change the source texture of the tileset.
Definition: TileLayer.h:111
An orthogonal orientation.
MapCellAxis
Map cell axis in a map celled.
Definition: MapCell.h:46
TileOrientation
The orientation of the tile.
Definition: TileTypes.h:37