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

Method InitText

ogsr_engine/xrGame/ui/UIXmlInit.cpp:279–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279bool CUIXmlInit::InitText(CUIXml& xml_doc, LPCSTR path, int index, CUIStatic* pWnd)
280{
281 InitText(xml_doc, path, index, (IUITextControl*)pWnd);
282 shared_str al = xml_doc.ReadAttrib(path, index, "vert_align", "");
283 if (0 == xr_strcmp(al, "c"))
284 pWnd->SetVTextAlignment(valCenter);
285 else if (0 == xr_strcmp(al, "b"))
286 pWnd->SetVTextAlignment(valBotton);
287 else if (0 == xr_strcmp(al, "t"))
288 pWnd->SetVTextAlignment(valTop);
289
290 pWnd->SetTextComplexMode(xml_doc.ReadAttribInt(path, index, "complex_mode", 0) ? true : false);
291
292 // Text coordinates
293 float text_x = xml_doc.ReadAttribFlt(path, index, "x", 0);
294 float text_y = xml_doc.ReadAttribFlt(path, index, "y", 0);
295 pWnd->SetTextX(text_x);
296 pWnd->SetTextY(text_y);
297
298 return true;
299}
300
301bool CUIXmlInit::InitText(CUIXml& xml_doc, const char* path, int index, IUITextControl* pWnd)
302{

Callers

nothing calls this directly

Calls 13

ReadAttribMethod · 0.80
ReadAttribIntMethod · 0.80
ReadAttribFltMethod · 0.80
xr_strcmpFunction · 0.50
SetVTextAlignmentMethod · 0.45
SetTextComplexModeMethod · 0.45
SetTextXMethod · 0.45
SetTextColorMethod · 0.45
SetFontMethod · 0.45
SetTextAlignmentMethod · 0.45
ReadMethod · 0.45
SetTextMethod · 0.45

Tested by

no test coverage detected