MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / DrawTexture

Method DrawTexture

ogsr_engine/xrGame/ui/UIButton.cpp:139–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void CUIButton::DrawTexture()
140{
141 Frect rect;
142 GetAbsoluteRect(rect);
143
144 if (m_bAvailableTexture && m_bTextureEnable)
145 {
146 if (m_eButtonState == BUTTON_UP || m_eButtonState == BUTTON_NORMAL)
147 m_UIStaticItem.SetPos(rect.left + m_TextureOffset.x, rect.top + m_TextureOffset.y);
148 else
149 m_UIStaticItem.SetPos(rect.left + m_PushOffset.x + m_TextureOffset.x, rect.top + m_PushOffset.y + m_TextureOffset.y);
150
151 if (m_bStretchTexture)
152 m_UIStaticItem.SetRect(0, 0, rect.width(), rect.height());
153 else
154 {
155 Frect r = {0, 0, m_UIStaticItem.GetOriginalRectScaled().width(), m_UIStaticItem.GetOriginalRectScaled().height()};
156 m_UIStaticItem.SetRect(r);
157 }
158
159 if (Heading())
160 m_UIStaticItem.Render(GetHeading());
161 else
162 m_UIStaticItem.Render();
163 }
164}
165
166void CUIButton::DrawHighlightedText()
167{

Callers

nothing calls this directly

Calls 8

HeadingFunction · 0.85
GetHeadingFunction · 0.85
SetRectMethod · 0.80
GetOriginalRectScaledMethod · 0.80
SetPosMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
RenderMethod · 0.45

Tested by

no test coverage detected