MCPcopy Create free account
hub / github.com/ddnet/ddnet / Draw

Method Draw

src/game/client/ui.cpp:57–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void CUIElement::SUIElementRect::Draw(const CUIRect *pRect, ColorRGBA Color, int Corners, float Rounding)
58{
59 bool NeedsRecreate = false;
60 if(m_UIRectQuadContainer == -1 || m_Width != pRect->w || m_Height != pRect->h || m_QuadColor != Color)
61 {
62 m_pParent->Ui()->Graphics()->DeleteQuadContainer(m_UIRectQuadContainer);
63 NeedsRecreate = true;
64 }
65 m_X = pRect->x;
66 m_Y = pRect->y;
67 if(NeedsRecreate)
68 {
69 m_Width = pRect->w;
70 m_Height = pRect->h;
71 m_QuadColor = Color;
72
73 m_pParent->Ui()->Graphics()->SetColor(Color);
74 m_UIRectQuadContainer = m_pParent->Ui()->Graphics()->CreateRectQuadContainer(0, 0, pRect->w, pRect->h, Rounding, Corners);
75 m_pParent->Ui()->Graphics()->SetColor(1, 1, 1, 1);
76 }
77
78 m_pParent->Ui()->Graphics()->TextureClear();
79 m_pParent->Ui()->Graphics()->RenderQuadContainerEx(m_UIRectQuadContainer,
80 0, -1, m_X, m_Y, 1, 1);
81}
82
83void SLabelProperties::SetColor(const ColorRGBA &Color)
84{

Callers 15

BeginMethod · 0.45
EndMethod · 0.45
DoHeaderMethod · 0.45
DoStartMethod · 0.45
DoNextItemMethod · 0.45
DoSubheaderMethod · 0.45
DoEditBoxMethod · 0.45
DoClearableEditBoxMethod · 0.45
DoButton_FontIconMethod · 0.45
DoButton_PopupMenuMethod · 0.45
DoScrollbarVMethod · 0.45

Calls 7

DeleteQuadContainerMethod · 0.80
TextureClearMethod · 0.80
RenderQuadContainerExMethod · 0.80
GraphicsMethod · 0.45
UiMethod · 0.45
SetColorMethod · 0.45

Tested by 1

OnRenderMethod · 0.36