Gamedev Framework (gf)  0.12.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::StaggerHelper Class Reference

A helper for computing coordinates in a staggered map. More...

#include <gf/Stagger.h>

Public Member Functions

 StaggerHelper (StaggerAxis axis, StaggerIndex index)
 
Vector2f computeCenter (Vector2i coords, Vector2f size) const
 Compute the center of the tile. More...
 

Detailed Description

A helper for computing coordinates in a staggered map.

Constructor & Destructor Documentation

◆ StaggerHelper()

gf::StaggerHelper::StaggerHelper ( StaggerAxis  axis,
StaggerIndex  index 
)
inline

Member Function Documentation

◆ computeCenter()

Vector2f gf::StaggerHelper::computeCenter ( Vector2i  coords,
Vector2f  size 
) const

Compute the center of the tile.

Parameters
coordsThe coordinates of the tile in the map
sizeThe size of the tile in the map
Returns
The position of the center