Difference between revisions of "DrawPane"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Draws a pane. </onlyinclude> <syntaxhighlight lang="cpp"> void DrawPane(const recti &rect) </syntaxhighlight> Category:Scripting Category:Global Functions")
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Draws a pane.
+
Draws a pane with a shape specified by the given [[rect]].
 
</onlyinclude>
 
</onlyinclude>
 +
 +
As this is GUI-related it is client only - it should be wrapped in "if ( getNet().isClient() )" or be in a client-only script.
 +
 +
This method is part of the GUI namespace so you need to prefix calls to it with 'GUI::'.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
void DrawPane(const recti &rect)
+
void GUI::DrawPane(const recti &rect)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Global Functions]]
 
[[Category:Global Functions]]
 +
 +
'''Example'''
 +
 +
<syntaxhighlight lang="cpp">
 +
void onRender(CRules@ this)
 +
{
 +
GUI::DrawPane(recti(position2di(getScreenWidth()/2-50, getScreenHeight()/2-50), dimension2di(100, 100)));
 +
}
 +
</syntaxhighlight>
 +
 +
[[File:GUIPane.png]]

Latest revision as of 21:55, 28 September 2012

Draws a pane with a shape specified by the given rect.


As this is GUI-related it is client only - it should be wrapped in "if ( getNet().isClient() )" or be in a client-only script.

This method is part of the GUI namespace so you need to prefix calls to it with 'GUI::'.

void GUI::DrawPane(const recti &rect)

Example

void onRender(CRules@ this)
{
	GUI::DrawPane(recti(position2di(getScreenWidth()/2-50, getScreenHeight()/2-50), dimension2di(100, 100)));
}

GUIPane.png