Difference between revisions of "GetElementSize"

From SIMboxWiki
Jump to navigation Jump to search
(Created page with 'You can set the position of an AGI based on the dimensions of its parent element using the getElementSize(...) method. The example code below positions m_hTestAgi in the center o…')
 
 
Line 7: Line 7:
 
Agi::SetXY(m_hTestAgi, 0.5f*fWidth, 0.5f*fHeight);
 
Agi::SetXY(m_hTestAgi, 0.5f*fWidth, 0.5f*fHeight);
  
</pre>
+
</pre>  
 +
[[Category:AGI_System]][[Category:Console_Object_Component]][[Category:Development_Articles]][[Category:Tutorials]][[Category:SDK]]

Latest revision as of 02:18, 26 February 2013

You can set the position of an AGI based on the dimensions of its parent element using the getElementSize(...) method. The example code below positions m_hTestAgi in the center of the element.

float fHeight = 0.0f;
float fWidth = 0.0f;

getElementSize(fWidth, fHeight);

Agi::SetXY(m_hTestAgi, 0.5f*fWidth, 0.5f*fHeight);