27#include "GraphicsApi.h"
28#include "Transformable.h"
30#include "VertexArray.h"
31#include "VertexBuffer.h"
34#ifndef DOXYGEN_SHOULD_SKIP_THIS
140 return m_selectedColor;
149 m_lineWidth = lineWidth;
202 Grid(
Vector2i gridSize, std::unique_ptr<Cells> properties);
204 void updateGeometry();
207 std::unique_ptr<Cells> m_properties;
217#ifndef DOXYGEN_SHOULD_SKIP_THIS
A grid of cells.
Definition: Grid.h:49
float getLineWidth() const noexcept
Get the width of the grid frame.
Definition: Grid.h:157
const Color4f & getColor() const noexcept
Get the color of the grid frame.
Definition: Grid.h:123
static Grid createHexagonal(Vector2i gridSize, float radius, CellAxis axis, CellIndex index)
Create a regular hexagonal grid.
static Grid createStaggered(Vector2i gridSize, Vector2f cellSize, CellAxis axis, CellIndex index)
Create a staggered grid.
static Grid createHexagonal(Vector2i gridSize, Vector2f cellSize, float sideLength, CellAxis axis, CellIndex index)
Create a hexagonal grid.
void hover(Vector2f pointer)
void draw(RenderTarget &target, const RenderStates &states) override
Draw the object to a render target.
void setLineWidth(float lineWidth) noexcept
Set the width of the grid frame.
Definition: Grid.h:148
void setAnchor(Anchor anchor)
Set the anchor origin of the entity.
void setGridSize(Vector2i gridSize)
Set the grid size.
VertexBuffer commitGeometry() const
Create a buffer with the current geometry.
void setSelectedColor(const Color4f &color)
Set the color of the selected cell.
RectF getLocalBounds() const
Get the local bounding rectangle of the entity.
const Color4f & getSelectedColor() const noexcept
Get the color of the selected cell.
Definition: Grid.h:139
void setColor(const Color4f &color)
Set the color of the grid frame.
static Grid createOrthogonal(Vector2i gridSize, Vector2f cellSize)
Create an orthogonal grid.
Vector2i getGridSize() const noexcept
Get the grid size.
Definition: Grid.h:107
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
A set of primitives.
Definition: VertexArray.h:65
Data in the graphics memory.
Definition: VertexBuffer.h:81
CellAxis
Cell axis for staggered or hexagonal maps.
Definition: CellTypes.h:48
CellIndex
Cell index for staggered or hexagonal maps.
Definition: CellTypes.h:37
Anchor
An anchor of a box.
Definition: Anchor.h:38
The namespace for gf classes.
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82
A 4D vector.
Definition: Vector.h:852