openclonk/docs/sdk/script/fn/GuiOpen.xml

47 lines
1.8 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>GuiOpen</title>
<category>GUI</category>
<version>7.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>proplist</type>
<name>properties</name>
<desc>Definition of the menu with a proplist. For details, see the <emlink href="script/GUI.html">GUI documentation</emlink>.</desc>
</param>
</params>
</syntax>
<desc>Opens a new GUI window that is defined by the passed proplist. When successful, returns the global ID of the new window (which is always bigger than 0). For all further interactions with the GUI (such as <funclink>GuiClose</funclink>() or <funclink>GuiUpdate</funclink>()), the ID needs to be passed as the parameter gui_id.</desc>
<remark>See the <emlink href="script/GUI.html">GUI documentation</emlink> for further explanations.</remark>
<examples>
<example>
<code>
var menu =
{
left_part =
{
Right = "50%",
BackgroundColor = <funclink>RGB</funclink>(255, 0, 0)
},
right_part =
{
Left = "50%",
BackgroundColor = <funclink>RGB</funclink>(0, 255, 0)
}
};
var menuID = <funclink>GuiOpen</funclink>(menu);
Schedule(nil, <funclink>Format</funclink>("<funclink>GuiClose</funclink>(%d)", menuID), 36, 0);</code>
<text>Defines a new GUI window and then shows it. The left half of the screen is red and the right half green. The window is closed again after one second.</text>
</example>
</examples>
<related><emlink href="script/GUI.html">GUI Documentation</emlink><funclink>GuiAction_Call</funclink><funclink>GuiAction_SetTag</funclink><funclink>GuiClose</funclink><funclink>GuiUpdate</funclink><funclink>GuiUpdateTag</funclink></related>
</func>
<author>Zapper</author><date>2014-10</date>
</funcs>