<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=GUI_Scripting%3A_In-World_Menu_Examples</id>
	<title>GUI Scripting: In-World Menu Examples - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=GUI_Scripting%3A_In-World_Menu_Examples"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;action=history"/>
	<updated>2026-04-18T05:41:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;diff=30092&amp;oldid=prev</id>
		<title>Geep: Add category tag</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;diff=30092&amp;oldid=prev"/>
		<updated>2022-11-04T17:37:55Z</updated>

		<summary type="html">&lt;p&gt;Add category tag&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:37, 4 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l212&quot;&gt;Line 212:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 212:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Cycling Images Instead of Text===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Cycling Images Instead of Text===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Each frob could cycle through background images instead of foreground text. If you needed to scale them, likely matscalex and matscaley will help.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Each frob could cycle through background images instead of foreground text. If you needed to scale them, likely matscalex and matscaley will help.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{GUI}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;diff=29805&amp;oldid=prev</id>
		<title>Geep: /* Setting Up the Entity */ drop mention of gui_noninteractive</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;diff=29805&amp;oldid=prev"/>
		<updated>2022-08-22T19:36:15Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Setting Up the Entity: &lt;/span&gt; drop mention of gui_noninteractive&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:36, 22 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gui  guis/testchooser.gui&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gui  guis/testchooser.gui&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gui_parm1 0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gui_parm1 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; gui_noninteractive 0      &#039;&#039;Doesn&#039;t hurt to set this&#039;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;Firepit&amp;quot;, &amp;quot;Spiders&amp;quot;, and &amp;quot;Fumes&amp;quot; implementations differ in their .script and testchooser.gui contents.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The &amp;quot;Firepit&amp;quot;, &amp;quot;Spiders&amp;quot;, and &amp;quot;Fumes&amp;quot; implementations differ in their .script and testchooser.gui contents.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;diff=29801&amp;oldid=prev</id>
		<title>Geep: create this article</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=GUI_Scripting:_In-World_Menu_Examples&amp;diff=29801&amp;oldid=prev"/>
		<updated>2022-08-22T16:39:14Z</updated>

		<summary type="html">&lt;p&gt;create this article&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;This is part of a series, [[GUI Scripting Language]]&amp;#039;&amp;#039;&lt;br /&gt;
==Introduction==&lt;br /&gt;
It is possible to offer the player a choice of some option using a menu on in-world surface, i.e., a menu that is not full-screen. Here, we look at a wall-plaque choice picker.&lt;br /&gt;
&lt;br /&gt;
The behavior for this choice picker will be modeled on the standard [[GUI Scripting: ChoiceDef | &amp;quot;choiceDef&amp;quot;]], used widely in TDM&amp;#039;s Settings main menu.  However, the behavior has to be somewhat modified, due to limitations with a gui-on-surface, discussed more fully in [[GUI Scripting: Interactions]]. In particular:&lt;br /&gt;
* No cursor is shown&lt;br /&gt;
* Frobbing (typically RMB) is used for choice selection instead of Action (typically LMB).&lt;br /&gt;
* Frob highlighting takes the place of mouse-over text glowing.&lt;br /&gt;
* As with a choiceDef, cycling through available choices is done by repeated clicking. However, choiceDef offers additional selection methods, involving keystrokes, beyond what can be done here.&lt;br /&gt;
&lt;br /&gt;
Three alternative implementations are shown, called &amp;quot;Firepit&amp;quot;, &amp;quot;Spiders&amp;quot;, and &amp;quot;Fumes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Setting Up the Entity==&lt;br /&gt;
All three examples will use the same entity, a stepped wall plaque composed from 2 rectangular brushes, combined into a func_static. See the &amp;quot;Adding Readables to your Map - from Scratch, Made from Brushes&amp;quot; section of [[Readables]] for how to do this, including texturing. For the specific entity here, use these dimensions and attributes:&lt;br /&gt;
* Inner and frontmost rectangle is 40w x 6h, with &amp;quot;Nodraw Solid&amp;quot; texture, except blue &amp;quot;Entity GUI&amp;quot; applied and fitted to front surface. This surface will show the menu text. We&amp;#039;ll use black text, but any color could be specified. (You can substitute a patch if you prefer.)&lt;br /&gt;
* Outer and rearmost rectangle is 42w x 8h. Its front surface will provide the background for the control. To provide contrast with the black menu text, a light color texture works (here, textures/darkmod/fabric/shadowable/cloth_plain_creased_white_dull ). This rectangle is needed for frob highlighting to work well.&lt;br /&gt;
&lt;br /&gt;
Once you&amp;#039;ve combined them into an entity, add these spawnargs:&lt;br /&gt;
 frob_action_script  change_choice&lt;br /&gt;
 frobable 1&lt;br /&gt;
 gui  guis/testchooser.gui&lt;br /&gt;
 gui_parm1 0&lt;br /&gt;
 gui_noninteractive 0      &amp;#039;&amp;#039;Doesn&amp;#039;t hurt to set this&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Firepit&amp;quot;, &amp;quot;Spiders&amp;quot;, and &amp;quot;Fumes&amp;quot; implementations differ in their .script and testchooser.gui contents.&lt;br /&gt;
&lt;br /&gt;
==Firepit – Emulating a ChoiceDef with a WindowDef==&lt;br /&gt;
The active surface will be subdivided into left and right windowDef cells of equal size. The left will get the &amp;quot;Firepit&amp;quot; prompt, left-justified. The right will be where the various choices cycle, right-justified: &amp;quot;Simmer&amp;quot;, &amp;quot;Bake&amp;quot;, &amp;quot;Broil&amp;quot;, and &amp;quot;Cremate&amp;quot;. Those words will be provided by the global script function &amp;quot;change_choice&amp;quot;, called on each frob, and passed to the testchooser.gui by GUI::Parameter choice_text. The GUI takes care of initializing this, in an onTime handler, while the script initializes the corresponding index.&lt;br /&gt;
&lt;br /&gt;
===The &amp;quot;change_choice&amp;quot; .script function===&lt;br /&gt;
This is contained in any convenient .script file:&lt;br /&gt;
 float picked = 0;  // global init.&lt;br /&gt;
 &lt;br /&gt;
 void change_choice(entity me)&lt;br /&gt;
 {&lt;br /&gt;
    //sys.println (&amp;quot;change_choice() called&amp;quot;);&lt;br /&gt;
    picked++;&lt;br /&gt;
    if(picked &amp;gt; 3)&lt;br /&gt;
      picked = 0;&lt;br /&gt;
    // DO HERE: Change game world to match&lt;br /&gt;
    string s;&lt;br /&gt;
    if(picked == 0)&lt;br /&gt;
      s = &amp;quot;Simmer&amp;quot;;&lt;br /&gt;
    else if (picked == 1)&lt;br /&gt;
      s = &amp;quot;Bake&amp;quot;;&lt;br /&gt;
    else if (picked == 2)&lt;br /&gt;
      s = &amp;quot;Broil&amp;quot;;&lt;br /&gt;
    else&lt;br /&gt;
      s = &amp;quot;Cremate&amp;quot;;&lt;br /&gt;
    me.setGuiString(1, &amp;quot;choice_text&amp;quot;, s);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
===The GUI===&lt;br /&gt;
Our guis/testchooser.gui is:&lt;br /&gt;
 #define ROW_START_Y 12&lt;br /&gt;
 #define CONTENTS_WIDTH 640&lt;br /&gt;
 #define CONTENTS_HEIGHT 96&lt;br /&gt;
 #define MY_SCALE forceaspectwidth CONTENTS_WIDTH  forceaspectheight CONTENTS_HEIGHT&lt;br /&gt;
 // Same ratio as blue Entity GUI surface of 40w x 6h&lt;br /&gt;
 &lt;br /&gt;
 // Background is rendered on separate surface&lt;br /&gt;
 windowDef Desktop&lt;br /&gt;
 {&lt;br /&gt;
  rect       0, 0, 640, 480&lt;br /&gt;
  backcolor  0, 0, 0, 0&lt;br /&gt;
  nocursor   1&lt;br /&gt;
  MY_SCALE&lt;br /&gt;
 &lt;br /&gt;
  windowDef Prompt {&lt;br /&gt;
      rect         0,ROW_START_Y,320,480&lt;br /&gt;
      textscale    0.9&lt;br /&gt;
      textalign    0 // left justified&lt;br /&gt;
      forecolor    0, 0, 0, .85&lt;br /&gt;
      font         &amp;quot;fonts/carleton_condensed&amp;quot;&lt;br /&gt;
      text         &amp;quot;Firepit&amp;quot;&lt;br /&gt;
      visible      1&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  windowDef Which {&lt;br /&gt;
      rect         320,ROW_START_Y,320,480&lt;br /&gt;
      textscale    0.9&lt;br /&gt;
      textalign    2 // right justified&lt;br /&gt;
      textalignx   -10&lt;br /&gt;
      forecolor    0, 0, 0, .85&lt;br /&gt;
      font         &amp;quot;fonts/carleton_condensed&amp;quot;&lt;br /&gt;
      text         &amp;quot;gui::choice_text&amp;quot;&lt;br /&gt;
      visible      1&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  onTime 0 {&lt;br /&gt;
      set &amp;quot;gui::choice_text&amp;quot; &amp;quot;Simmer&amp;quot;;  // same as picked == 0 in script&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
==Spiders – Driving a ChoiceDef from a Script==&lt;br /&gt;
In this version, instead of emulating a choiceDef, we actually use it, although driven indirectly through the script function. That function, instead of passing the string to the GUI, passes the numeric index that a choiceDef knows about. Since the &amp;quot;picked_index&amp;quot; is initialized in the GUI, it&amp;#039;s unnecessary to do so in the SCRIPT file. See also [[GUI Scripting: ChoiceDef]].&lt;br /&gt;
&lt;br /&gt;
For Spiders, the example has a different set of choices than Firepit, repurposing an i18n string that&amp;#039;s already provided in the standard distribution for AIVision settings: &amp;quot;Nearly Blind;Forgiving;Challenging;Hardcore&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===The &amp;quot;change_choice&amp;quot; .script function===&lt;br /&gt;
 void change_choice(entity me)&lt;br /&gt;
 {&lt;br /&gt;
    //sys.println (&amp;quot;change_choice() called&amp;quot;);&lt;br /&gt;
    float i = me.getGuiInt(1, &amp;quot;picked_index&amp;quot;);&lt;br /&gt;
    i++;&lt;br /&gt;
    if(i &amp;gt; 3)&lt;br /&gt;
      i = 0;&lt;br /&gt;
    me.setGuiInt(1, &amp;quot;picked_index&amp;quot;, i);&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
===The GUI===&lt;br /&gt;
In this version of testchooser.gui, the initial #defines and the Desktop and Prompt windowDefs are the same (except for Prompt, the &amp;quot;text&amp;quot; reads &amp;quot;Spiders&amp;quot; instead of &amp;quot;Firepit&amp;quot;). Here&amp;#039;s what&amp;#039;s changed:&lt;br /&gt;
 ...&lt;br /&gt;
  choiceDef Which {&lt;br /&gt;
      rect   320,ROW_START_Y,320,480&lt;br /&gt;
      MY_SCALE&lt;br /&gt;
      choices      &amp;quot;#str_07323&amp;quot;  // Nearly Blind;Forgiving;Challenging;Hardcore&lt;br /&gt;
      values       &amp;quot;0;1;2;3&amp;quot;&lt;br /&gt;
      textscale    0.9&lt;br /&gt;
      textalign    2 // right justified&lt;br /&gt;
      textalignx   -10&lt;br /&gt;
      forecolor    0, 0, 0, .85&lt;br /&gt;
      font         &amp;quot;fonts/carleton_condensed&amp;quot;&lt;br /&gt;
      gui          &amp;quot;picked_index&amp;quot; // this is driven from script, responding to frob&lt;br /&gt;
      choiceType   0&lt;br /&gt;
      visible      1&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  onTime 0 {&lt;br /&gt;
    set &amp;quot;gui::picked_index&amp;quot; 0;&lt;br /&gt;
  }&lt;br /&gt;
 ...&lt;br /&gt;
In the choiceDef, MY_SCALE had to be added to prevent font smear. (Evidently, it differs from windowDef children, where the &amp;quot;forceaspect…&amp;quot; properties are expressed in a parent.)&lt;br /&gt;
&lt;br /&gt;
==Fumes – Adding Choice Transitions==&lt;br /&gt;
To allow the choice text to change with a fade in/fade out, start with the Firepit GUI example, and clone the righthand windowDef, creating a separate one for each of the 4 possible hardcoded text strings. They&amp;#039;ll all be formally visible, but the alpha of forecolor is 0 (so hidden) unless transitioned to 0.85. On the script side, a picked_index is passed to the GUI, as in the Spiders example, but with an event added to drive the transitions.&lt;br /&gt;
&lt;br /&gt;
===The &amp;quot;change_choice&amp;quot; .script function===&lt;br /&gt;
The Spiders script function is just like Firepit&amp;#039;s but with this line at the end:&lt;br /&gt;
 me.callGui(1,&amp;quot;UpdateChoice&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===The GUI===&lt;br /&gt;
In this version of testchooser.gui, more #defines are added, so that the transitions and cloned windowDefs can be succinct and uniform:&lt;br /&gt;
 #define NO_TEXT 0,0,0,0&lt;br /&gt;
 #define SNO_TEXT &amp;quot;0 0 0 0&amp;quot;&lt;br /&gt;
 #define SNORMAL_TEXT &amp;quot;0 0 0 0.85&amp;quot;&lt;br /&gt;
 #define FADE_TIME 200 // milliseconds&lt;br /&gt;
 #define WHICH_BASE  rect 320,ROW_START_Y,320,480  textscale 0.9  textalign 2  textalignx -10  font &amp;quot;fonts/carleton_condensed&amp;quot;  visible 1  forecolor NO_TEXT&lt;br /&gt;
&lt;br /&gt;
The Desktop and Prompt windowDefs are the same (except Prompt&amp;#039;s &amp;quot;text&amp;quot; is &amp;quot;Fumes&amp;quot;). Then the latter part of the .gui becomes:&lt;br /&gt;
  windowDef Which0 {&lt;br /&gt;
      WHICH_BASE&lt;br /&gt;
      text        &amp;quot;Whiff&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  windowDef Which1 {&lt;br /&gt;
      WHICH_BASE&lt;br /&gt;
      text        &amp;quot;Haze&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  windowDef Which2 {&lt;br /&gt;
      WHICH_BASE&lt;br /&gt;
      text        &amp;quot;Stinging&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  windowDef Which3 {&lt;br /&gt;
      WHICH_BASE&lt;br /&gt;
      text        &amp;quot;Fatal&amp;quot;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  onNamedEvent UpdateChoice {&lt;br /&gt;
      if(&amp;quot;gui::picked_index&amp;quot; == 0) {&lt;br /&gt;
          transition &amp;quot;Which3::forecolor&amp;quot;  SNORMAL_TEXT  SNO_TEXT  FADE_TIME;&lt;br /&gt;
          transition &amp;quot;Which0::forecolor&amp;quot;  SNO_TEXT  SNORMAL_TEXT  FADE_TIME;&lt;br /&gt;
      }&lt;br /&gt;
      else if (&amp;quot;gui::picked_index&amp;quot; == 1) {&lt;br /&gt;
          transition &amp;quot;Which0::forecolor&amp;quot;  SNORMAL_TEXT  SNO_TEXT  FADE_TIME;&lt;br /&gt;
          transition &amp;quot;Which1::forecolor&amp;quot;  SNO_TEXT  SNORMAL_TEXT  FADE_TIME;&lt;br /&gt;
      }&lt;br /&gt;
      else if (&amp;quot;gui::picked_index&amp;quot; == 2) {&lt;br /&gt;
          transition &amp;quot;Which1::forecolor&amp;quot;  SNORMAL_TEXT  SNO_TEXT  FADE_TIME;&lt;br /&gt;
          transition &amp;quot;Which2::forecolor&amp;quot;  SNO_TEXT  SNORMAL_TEXT  FADE_TIME;&lt;br /&gt;
      }&lt;br /&gt;
      else { // &amp;quot;gui::picked_index&amp;quot; == 3&lt;br /&gt;
          transition &amp;quot;Which2::forecolor&amp;quot;  SNORMAL_TEXT  SNO_TEXT  FADE_TIME;&lt;br /&gt;
          transition &amp;quot;Which3::forecolor&amp;quot;  SNO_TEXT  SNORMAL_TEXT  FADE_TIME;&lt;br /&gt;
      }&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  onTime 0 {&lt;br /&gt;
    set &amp;quot;gui::picked_index&amp;quot; 0;&lt;br /&gt;
    set &amp;quot;Which0::forecolor&amp;quot; SNORMAL_TEXT ;&lt;br /&gt;
  }&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
==Other Ideas==&lt;br /&gt;
===Add Magic===&lt;br /&gt;
You could enhance the script to trigger a puff of smoke or some sparks in front of the choice when it changes.&lt;br /&gt;
&lt;br /&gt;
===Multirow Menu - Separate Items===&lt;br /&gt;
If you wanted to have a multirow menu, where each row provided choices for a different option (like the Settings menus), you could build it from separately-frobbable 1-row entities as above, stacked like wall tiles. Names of things would have to change to differentiate them, and frob-related attributes tweaked to avoid spatial conflicts; see [[Frobbing]].&lt;br /&gt;
&lt;br /&gt;
===Multirow Menus - Single Item===&lt;br /&gt;
With just one entity, it might be possible to emulate or repurpose a listDef, but where each frob click changed the row, and the selected row was indicated by an icon or color swatch.&lt;br /&gt;
&lt;br /&gt;
===Bomb Timer===&lt;br /&gt;
Frob on the entity, and it starts showing seconds being counted down. Further frobbing does nothing. This involves an endless loop in the script file, something a script object is ideal for.&lt;br /&gt;
&lt;br /&gt;
===Price of Gold===&lt;br /&gt;
Imagine that the price of gold nuggets varied during the game, either randomly or in response to what has happened so far. You could have a display show it, using a polling script object to invent the current value. This display might not require any frobbing. (A non-frobbable entity wouldn&amp;#039;t require a stepped entity... a nodraw rectangle with an &amp;quot;GUI Entity&amp;quot; would be enough.)&lt;br /&gt;
&lt;br /&gt;
===Cycling Images Instead of Text===&lt;br /&gt;
Each frob could cycle through background images instead of foreground text. If you needed to scale them, likely matscalex and matscaley will help.&lt;/div&gt;</summary>
		<author><name>Geep</name></author>
	</entry>
</feed>