<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Adding_%27Look%27_On_Right_Click</id>
	<title>Adding &#039;Look&#039; On Right Click - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.sierrahelp.com/index.php?action=history&amp;feed=atom&amp;title=Adding_%27Look%27_On_Right_Click"/>
	<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;action=history"/>
	<updated>2026-12-05T11:17:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;diff=93566&amp;oldid=prev</id>
		<title>Andrew Branscom at 20:06, 28 April 2025</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;diff=93566&amp;oldid=prev"/>
		<updated>2025-04-28T20:06:51Z</updated>

		<summary type="html">&lt;p&gt;&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 15:06, 28 April 2025&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-l99&quot;&gt;Line 99:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 99:&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;&amp;lt;/syntaxhighlight&amp;gt;&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;&amp;lt;/syntaxhighlight&amp;gt;&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;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 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;==&amp;lt;br /&amp;gt; References ==&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;&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;&amp;lt;references /&amp;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;&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;==&amp;lt;br /&amp;gt; Related Links ==&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;&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;* &amp;amp;nbsp;&lt;/ins&gt;&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;&amp;amp;nbsp;&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;&amp;amp;nbsp;&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;&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;div&gt;[[Category:Examples]]&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;[[Category:Examples]]&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;[[Category:SCI How To]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;diff=92571&amp;oldid=prev</id>
		<title>Andrew Branscom: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;diff=92571&amp;oldid=prev"/>
		<updated>2025-04-26T22:29:01Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:29, 26 April 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
	<entry>
		<id>http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;diff=92570&amp;oldid=prev</id>
		<title>Andrew Branscom: Andrew Branscom moved page &#039;Look&#039; On Right Click to Adding &#039;Look&#039; On Right Click</title>
		<link rel="alternate" type="text/html" href="http://wiki.sierrahelp.com/index.php?title=Adding_%27Look%27_On_Right_Click&amp;diff=92570&amp;oldid=prev"/>
		<updated>2013-10-31T00:16:50Z</updated>

		<summary type="html">&lt;p&gt;Andrew Branscom moved page &lt;a href=&quot;/index.php/%27Look%27_On_Right_Click&quot; title=&quot;&amp;#039;Look&amp;#039; On Right Click&quot;&gt;&amp;#039;Look&amp;#039; On Right Click&lt;/a&gt; to &lt;a href=&quot;/index.php/Adding_%27Look%27_On_Right_Click&quot; title=&quot;Adding &amp;#039;Look&amp;#039; On Right Click&quot;&gt;Adding &amp;#039;Look&amp;#039; On Right Click&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:SCI Pages]]&lt;br /&gt;
[[Category:Temp SCI Pages]]&lt;br /&gt;
&amp;#039;&amp;#039;Originally posted on the [[scipf:topic,624.html|SCI Programming Forums]] by [[Gumby]].&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To accomplish this we will use the priority colors - you can use the control colors as well.&lt;br /&gt;
&lt;br /&gt;
Step 1:  Trace &amp;amp; fill all the objects in your room with a priority color.  For immediately adjacent objects, use a different color.&lt;br /&gt;
&lt;br /&gt;
Step 2:  Determine the bounding rectangle around each object.  This will allow you to re-use a priority color more than once per room.  Note that you can have overlapping bounding rectangles for objects - just make sure that the objects have different priority colors.  To aid with determining the coordinates of the rectangles, temporarily include the following code in your handleEvent method to give you the cursor hotspot location on a right-click:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;&lt;br /&gt;
        (if(== (send pEvent:type) evMOUSEBUTTON and == (send pEvent:modifiers) 515)&lt;br /&gt;
            FormatPrint(&amp;quot;x:%d, y:%d&amp;quot; (send pEvent:x) (send pEvent:y) )	 &lt;br /&gt;
	)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Tip:  Even easier, in the picture editor (either Studio or Companion) use the x/y coordinate indicator to get the current location of the mouse.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Step 3: Modify your &amp;#039;look&amp;#039; logic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;&lt;br /&gt;
        (if(Said(&amp;#039;look/box&amp;#039;)&lt;br /&gt;
        	or&lt;br /&gt;
                   (    == (send pEvent:type) evMOUSEBUTTON  // mouse click&lt;br /&gt;
        	    and == (send pEvent:modifiers) 515   // specifically a right mouse click&lt;br /&gt;
        	    and == $0002 OnControl(ocPRIORITY (send pEvent:x) (send pEvent:y))  // on NAVY priority color&lt;br /&gt;
&lt;br /&gt;
                    // check that the mouse is in the bounding rectangle for this object&lt;br /&gt;
        	    and &amp;gt; (send pEvent:x) 93&lt;br /&gt;
        	    and &amp;lt; (send pEvent:x) 132&lt;br /&gt;
        	    and &amp;gt; (send pEvent:y) 78&lt;br /&gt;
        	    and &amp;lt; (send pEvent:y) 110&lt;br /&gt;
                   )&lt;br /&gt;
           )&lt;br /&gt;
           Print(&amp;quot;The box is closed&amp;quot;)&lt;br /&gt;
	)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
For much cleaner implementation, create a class and then create instances of the class for each right-clickable area:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;&lt;br /&gt;
(class MouseLookObj&lt;br /&gt;
   (properties&lt;br /&gt;
      priorityColor $0000&lt;br /&gt;
      xMin 0&lt;br /&gt;
      xMax 0&lt;br /&gt;
      yMin 0&lt;br /&gt;
      yMax 0&lt;br /&gt;
   )&lt;br /&gt;
   (method (rightClicked pEvent)&lt;br /&gt;
   	  MouseLook(pEvent)&lt;br /&gt;
   )   &lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
(procedure (MouseLook pEvent) of MouseLookObj&lt;br /&gt;
       (if (== (send pEvent:type) evMOUSEBUTTON&lt;br /&gt;
    	    and == (send pEvent:modifiers) 515&lt;br /&gt;
    	    and == priorityColor OnControl(ocPRIORITY (send pEvent:x) (send pEvent:y))&lt;br /&gt;
    		and &amp;gt; (send pEvent:x) xMin&lt;br /&gt;
    		and &amp;lt; (send pEvent:x) xMax&lt;br /&gt;
    		and &amp;gt; (send pEvent:y) yMin&lt;br /&gt;
    		and &amp;lt; (send pEvent:y) yMax)&lt;br /&gt;
	      return(TRUE)&lt;br /&gt;
	)&lt;br /&gt;
        return(FALSE)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Then in your room script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;CodeBlockHeader&amp;quot;&amp;gt;Code:&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sci&amp;quot;&amp;gt;&lt;br /&gt;
(instance public BoxLook of MouseLookObj&lt;br /&gt;
    (properties &lt;br /&gt;
        priorityColor $0002 &lt;br /&gt;
        xMin  93 &lt;br /&gt;
        xMax 132 &lt;br /&gt;
        yMin  78&lt;br /&gt;
        yMax 110&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
(if(Said(&amp;#039;look/box&amp;#039;) or BoxLook:rightClicked(pEvent))&lt;br /&gt;
    Print(&amp;quot;The box is closed&amp;quot;)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;/div&gt;</summary>
		<author><name>Andrew Branscom</name></author>
	</entry>
</feed>