Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
SelectionEffectRenderer.cpp
Go to the documentation of this file.
2
3namespace Olympe
4{
6 : m_glowColor(0.0f, 0.8f, 1.0f),
7 m_glowAlpha(0.6f),
8 m_baseGlowSize(8.0f),
9 m_borderWidthMultiplier(3.0f),
10 m_glowEnabled(true)
11 {
12 }
13
15 const ImVec2& minScreen,
16 const ImVec2& maxScreen,
17 float canvasZoom,
18 float nodeScale,
19 float cornerRadius) const
20 {
21 if (!m_glowEnabled) { return; }
22
23 ImDrawList* drawList = ImGui::GetWindowDrawList();
24 if (drawList == nullptr) { return; }
25
26 // Compute glow size scaled by zoom and node scale
28
29 // Glow color with alpha
30 ImU32 glowColor = ImGui::GetColorU32(ImVec4(
35 ));
36
37 // Draw glow as expanded rounded rectangle behind the node
38 drawList->AddRectFilled(
42 cornerRadius + glowSize
43 );
44 }
45
47 const ImVec2& minScreen,
48 const ImVec2& maxScreen,
50 float baseWidth,
51 float canvasZoom,
52 float cornerRadius) const
53 {
54 ImDrawList* drawList = ImGui::GetWindowDrawList();
55 if (drawList == nullptr) { return; }
56
57 // Apply multiplier to border width
58 float borderWidth = baseWidth * m_borderWidthMultiplier * canvasZoom;
59 borderWidth = (borderWidth < 1.0f) ? 1.0f : borderWidth; // Minimum 1 pixel
60
61 drawList->AddRect(
65 cornerRadius,
67 borderWidth
68 );
69 }
70
72 const ImVec2& minScreen,
73 const ImVec2& maxScreen,
75 float baseWidth,
76 float canvasZoom,
77 float nodeScale,
78 float cornerRadius) const
79 {
82 }
83
84 // ===== Preset Styles =====
85
87 {
88 m_glowColor = {0.0f, 0.8f, 1.0f};
89 m_glowAlpha = 0.6f;
90 m_baseGlowSize = 8.0f;
92 }
93
95 {
96 m_glowColor = {1.0f, 0.84f, 0.0f}; // Gold
97 m_glowAlpha = 0.6f;
98 m_baseGlowSize = 9.0f;
100 }
101
103 {
104 m_glowColor = {0.0f, 1.0f, 0.5f}; // Bright green
105 m_glowAlpha = 0.65f;
106 m_baseGlowSize = 8.5f;
108 }
109
111 {
112 m_glowColor = {0.8f, 0.2f, 1.0f}; // Purple/Magenta
113 m_glowAlpha = 0.6f;
114 m_baseGlowSize = 8.5f;
116 }
117
119 {
120 m_glowColor = {1.0f, 0.2f, 0.2f}; // Red
121 m_glowAlpha = 0.65f;
122 m_baseGlowSize = 9.0f;
124 }
125
126} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
void RenderCompleteSelection(const ImVec2 &minScreen, const ImVec2 &maxScreen, ImU32 borderColor, float baseWidth, float canvasZoom=1.0f, float nodeScale=1.0f, float cornerRadius=5.0f) const
Rend l'ensemble de l'effet de sélection (glow + bordure)
void RenderSelectionGlow(const ImVec2 &minScreen, const ImVec2 &maxScreen, float canvasZoom=1.0f, float nodeScale=1.0f, float cornerRadius=5.0f) const
Dessine le glow de sélection (fond lumineux)
void ApplyStyle_OlympeBlue()
Style standard "Olympe Blue" - Cyan vif avec glow modéré
void RenderSelectionBorder(const ImVec2 &minScreen, const ImVec2 &maxScreen, ImU32 borderColor, float baseWidth, float canvasZoom=1.0f, float cornerRadius=5.0f) const
Rend la bordure de sélection (épaissie)
void ApplyStyle_GreenEnergy()
Style "Green Energy" - Vert lumineux pour emphasis.
void ApplyStyle_RedAlert()
Style "Red Alert" - Rouge vif pour avertissements/erreurs.
void ApplyStyle_PurpleMystery()
Style "Purple Mystery" - Violet/magenta.
void ApplyStyle_GoldAccent()
Style "Gold Accent" - Orange/or pour éditeurs de spécialité
float z
Definition vector.h:25
float y
Definition vector.h:25
float x
Definition vector.h:25
< Provides AssetID and INVALID_ASSET_ID