FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::Grid Class Reference

Represents a singular grid. More...

#include <Grid.h>

Public Member Functions

 Grid (int gridWidth, int gridHeight, Col opposite)
 Creates a grid overlay with the given cell size and contrast color.
 ~Grid ()
void RenderWithDrawList (ImDrawList *drawList, ImVec2 startPos, ImVec2 endPos) const
 Draws the grid into the provided ImGui draw list.
void ShowGrid ()
 Makes the grid visible.
void HideGrid ()
 Hides the grid.
void ToggleGrid ()
 Toggles grid visibility.
bool GridVisibility () const
 Returns whether the grid is currently visible.
void SetGridWidth (int gridWidth)
 Updates the horizontal grid spacing.
void SetGridHeight (int gridHeight)
 Updates the vertical grid spacing.
int GridWidth () const
 Returns the horizontal grid spacing.
int GridHeight () const
 Returns the vertical grid spacing.

Private Attributes

int m_GridWidth
int m_GridHeight
bool m_ShowGrid {false}
Col m_OppositeCol

Detailed Description

Represents a singular grid.

Note
Should only be instantiated once so no grid desync happens.

Constructor & Destructor Documentation

◆ Grid()

FuncDoodle::Grid::Grid ( int gridWidth,
int gridHeight,
Col opposite )

Creates a grid overlay with the given cell size and contrast color.

◆ ~Grid()

FuncDoodle::Grid::~Grid ( )
default

Member Function Documentation

◆ GridHeight()

int FuncDoodle::Grid::GridHeight ( ) const
inline

Returns the vertical grid spacing.

◆ GridVisibility()

bool FuncDoodle::Grid::GridVisibility ( ) const
inline

Returns whether the grid is currently visible.

◆ GridWidth()

int FuncDoodle::Grid::GridWidth ( ) const
inline

Returns the horizontal grid spacing.

◆ HideGrid()

void FuncDoodle::Grid::HideGrid ( )
inline

Hides the grid.

◆ RenderWithDrawList()

void FuncDoodle::Grid::RenderWithDrawList ( ImDrawList * drawList,
ImVec2 startPos,
ImVec2 endPos ) const

Draws the grid into the provided ImGui draw list.

◆ SetGridHeight()

void FuncDoodle::Grid::SetGridHeight ( int gridHeight)
inline

Updates the vertical grid spacing.

◆ SetGridWidth()

void FuncDoodle::Grid::SetGridWidth ( int gridWidth)
inline

Updates the horizontal grid spacing.

◆ ShowGrid()

void FuncDoodle::Grid::ShowGrid ( )
inline

Makes the grid visible.

◆ ToggleGrid()

void FuncDoodle::Grid::ToggleGrid ( )
inline

Toggles grid visibility.

Member Data Documentation

◆ m_GridHeight

int FuncDoodle::Grid::m_GridHeight
private

◆ m_GridWidth

int FuncDoodle::Grid::m_GridWidth
private

◆ m_OppositeCol

Col FuncDoodle::Grid::m_OppositeCol
private

◆ m_ShowGrid

bool FuncDoodle::Grid::m_ShowGrid {false}
private

The documentation for this class was generated from the following files: