mirror of
https://github.com/ddnet/ddnet.git
synced 2024-10-20 15:58:18 +00:00
33 lines
519 B
C++
33 lines
519 B
C++
#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;
|
|
|
|
/**
|
|
* Returns whether the grid is rendered.
|
|
*/
|
|
bool IsEnabled() const;
|
|
|
|
void Toggle();
|
|
|
|
int Factor() const;
|
|
void ResetFactor();
|
|
void IncreaseFactor();
|
|
void DecreaseFactor();
|
|
|
|
private:
|
|
bool m_GridActive;
|
|
int m_GridFactor;
|
|
};
|
|
|
|
#endif
|