Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | List of all members
Olympe::CanvasGridRenderer Class Reference

Shared utility for rendering grid backgrounds on any canvas editor. More...

#include <CanvasGridRenderer.h>

Classes

struct  GridConfig
 Configuration parameters for grid rendering. More...
 

Public Types

enum  GridStylePreset { Style_VisualScript , Style_Compact , Style_Spacious }
 Pre-configured grid styles matching professional editors. More...
 

Static Public Member Functions

static GridConfig GetStylePreset (GridStylePreset preset)
 Get pre-configured grid style (VisualScript/Compact/Spacious)
 
static void RenderGrid (ImDrawList *drawList, const GridConfig &config)
 Render a grid on the given ImDrawList.
 
static void RenderGrid (const GridConfig &config)
 Convenience overload using ImGui's current context.
 

Detailed Description

Shared utility for rendering grid backgrounds on any canvas editor.

Provides configurable grid rendering with support for:

Definition at line 18 of file CanvasGridRenderer.h.

Member Enumeration Documentation

◆ GridStylePreset

Pre-configured grid styles matching professional editors.

Enumerator
Style_VisualScript 
Style_Compact 
Style_Spacious 

Definition at line 25 of file CanvasGridRenderer.h.

Member Function Documentation

◆ GetStylePreset()

CanvasGridRenderer::GridConfig Olympe::CanvasGridRenderer::GetStylePreset ( GridStylePreset  preset)
static

Get pre-configured grid style (VisualScript/Compact/Spacious)

Parameters
presetThe style preset to use
Returns
GridConfig initialized with preset values

Definition at line 6 of file CanvasGridRenderer.cpp.

References GetComponentTypeID_Static(), Olympe::CanvasGridRenderer::GridConfig::majorSpacing, Style_Compact, Style_Spacious, and Style_VisualScript.

Referenced by Olympe::CustomCanvasEditor::GetGridConfig(), Olympe::ImNodesCanvasEditor::GetGridConfig(), Olympe::PrefabCanvas::RenderGrid(), Olympe::CustomCanvasEditor::RenderGrid(), and Olympe::ImNodesCanvasEditor::RenderGrid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RenderGrid() [1/2]

void Olympe::CanvasGridRenderer::RenderGrid ( const GridConfig config)
static

Convenience overload using ImGui's current context.

Parameters
configGrid configuration parameters

Definition at line 144 of file CanvasGridRenderer.cpp.

References GetComponentTypeID_Static(), and RenderGrid().

+ Here is the call graph for this function:

◆ RenderGrid() [2/2]

void Olympe::CanvasGridRenderer::RenderGrid ( ImDrawList drawList,
const GridConfig config 
)
static

Render a grid on the given ImDrawList.

Parameters
drawListImGui draw list to render to
configGrid configuration parameters

Definition at line 50 of file CanvasGridRenderer.cpp.

References GetComponentTypeID_Static().

Referenced by Olympe::PrefabCanvas::RenderGrid(), Olympe::CustomCanvasEditor::RenderGrid(), Olympe::ImNodesCanvasEditor::RenderGrid(), and RenderGrid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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