2023-08-14 14:52:17 +00:00
|
|
|
#ifndef GAME_EDITOR_MAP_GRID_H
|
|
|
|
#define GAME_EDITOR_MAP_GRID_H
|
|
|
|
|
|
|
|
#include "component.h"
|
|
|
|
|
|
|
|
class CMapGrid : public CEditorComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void OnReset() override;
|
|
|
|
void OnRender(CUIRect View) override;
|
|
|
|
|
|
|
|
void SnapToGrid(float &x, float &y);
|
|
|
|
int GridLineDistance() const;
|
|
|
|
|
|
|
|
/**
|
2023-09-05 19:24:33 +00:00
|
|
|
* Returns whether the grid is rendered.
|
2023-08-14 14:52:17 +00:00
|
|
|
*/
|
|
|
|
bool IsEnabled() const;
|
|
|
|
|
|
|
|
void Toggle();
|
|
|
|
|
2023-11-17 20:52:39 +00:00
|
|
|
int Factor() const;
|
2023-08-14 14:52:17 +00:00
|
|
|
void ResetFactor();
|
|
|
|
void IncreaseFactor();
|
|
|
|
void DecreaseFactor();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_GridActive;
|
|
|
|
int m_GridFactor;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|