The following parameters are supported:
In VRSmarty xml file:
| xmlFile | xmlFile='myMenu.xml' | plugin control XML file, default=spotmenu.xml |
Plugin attributes:set with spot_id.content.name=value
| xmlFile | xmlFile='myNewMenu.xml' | new XML file will rebuild menu |
Plugin methods: call with spot_id.content.name(value)
| setOnClick('id','cmd') | setOnClick('item3','goPano8') | assign new onClick command to menu item |
| click('id') | click('item7') | simulate menu item being clicked |
| select('id') | select('item2') | make menu item selected |
| unselect() | unselect() | unselect any selected menu item |
| disable('id') | disable('item2') | Set menu item as disabled (not selectable) |
| enable('id') | enable('item1') | Set menu item as enabled (selectable) |
Plugin external xml file:
| In <spotmenu> tag: |
| size | size="124:500" | menu size, if not given menu will be autosized |
| bgColor | bgColor="#CFCFC0" | menu background color, default=no background |
| bgImage | bgImage="img/menubg5.jpg" | menu background image |
| borderColor | borderColor="#000000" | menu border color, default=no border |
| title | title="My VRSmarty menu" | menu title, default=no title |
| itemSpace | itemSpace="5" | extra vertical space between menu items, default=0 |
| selectMode | selectMode="3" | menu item behaviour after being clicked: (see NOTES below) |
| | 1 = selected and not clickable (default) |
| | 2 = selected and clickable |
| | 3 = not selected and clickable |
| draggable | draggable="1" | makes menu draggable (requires menu title) |
| In <menuItems><item> childtag: |
| id | id="p12" | image id (optional), used as reference when using |
| | the "click" or "select" parameters |
| text | text="Train Station" | menu item text |
| | text="-" will generate a menu separator |
| image | image="img/train.png" | menu item icon image |
| addSpace | addSpace="20" | additional space before menu item, default=0 |
| onClick | onClick="global.goPano2" | menu item onClick command |
| onOver | onOver="pic3.visible=1" | menu item onOver command |
| onOut | onOut="pic3.visible=0" | menu item onOut command |
| selected | selected="1" | menu item selected at start, default=0 |
| enabled | enabled="0" | menu item enabled/disabled at start, default=1 |
| heading | heading="1" | makes this item a heading, default=0 |
| subheading | subheading="1" | makes this item a subheading, default=0 |
Use the
<fonts> tag with its childtags to set the
visual attributes for the menu:
| In <fonts> tag: |
| <title> childtag | menu title attributes |
| <heading> childtag | menu heading attributes |
| <subheading> childtag | menu subheading attributes |
| <item> childtag | menu item attributes |
| <selected> childtag | selected menu item attributes |
| <mouseOver> childtag | mouse-over menu item attributes |
| <disabled> childtag | disabled menu item attributes |
Each of the childtags above supports the following attributes:
| font | font="Helvetica" | text font name |
| textSize | textSize="16" | text size |
| textColor | textColor="#FFFFFF" | text color |
| bold | bold="1" | text bold attribute |
| italic | italic="1" | text italic attribute |
| underline | underline="1" | text underline attribute |
| bgColor | bgColor="#F00000" | background color |
| borderColor | borderColor="#A0A0C0" | border color |
NOTES:
If a background image is larger than the menu, it will be automatically masked.
The
selectMode="n" attribute controls what happens with a menu item after it has been clicked. If
you want it to be
selected and not clickable again, use
selectMode="1" which is default. If you
want it to be
selected but clickable again use
selectMode="2". And if you want it to be
not
selected and of course clickable again, use
selectMode="3".
The "
click('xxx') method can be used at any time to simulate a menu item click. The onClick
command will be executed.
The "
select('xxx') method can also be used to select a menu item. But the onClick command will
NOT be executed.
If the "
id" attribute has not been specified for menu items, the parameter in the "click" and "select"
commands will be matched against the menu item "text" attribute.
Heading/subheading items that has got the
onClick attribute specified will be clickable as
shown by the hand-cursor at mouse-over.
Example menu <spot>:
<!-- plugin hotspots -->
<spot id="menu2" url="spotmenu.swf" layerType="pano" type="static" staticAlign="RC" align="RC"
staticX="10" staticY="80" mouseChildren="true" blockMouse="true"
xmlFile="menu22.xml"
/>
Example plugin xml file:
<?xml version = '1.0'?>
<spotmenu
size="200:250"
bgColor="#FFFFFF"
borderColor="#000000"
title="My menu 2"
itemSpace="2"
selectMode="2"
>
<fonts>
<title font="Helvetica" textSize="16" textColor="#FFFFFF" bgColor="#0000F0" bold="1" />
<item font="Helvetica" textSize="14" textColor="#000000" />
<selected textColor="#FFFFFF" bgColor="#333333" />
<mouseOver bgColor="#F8F8FF" borderColor="#A0A0C0" bold="1" />
<disabled textColor="#A0A0A0" italic="1" />
</fonts>
<menuItems>
<item id="M1" text="City Hall Tower" image="img/camera2.png" onClick="showFake()" />
<item id="M2" text="Maria Hill" image="img/camera1.png" onClick="showFake()" />
<item text="-" />
<item id="M3" text="%C5SS bridge" image="img/yacht2.png" onClick="showFake()" />
<item id="M4" text="Where I work" image="img/work.png" onClick="showFake()" enabled="0" />
<item id="M5" text="The Train Bridge" image="img/train.png" onClick="showFake()" selected="1" />
<item text="-" />
<item id="M6" text="My home" image="img/home.png" onClick="showFake()" />
<item id="M7" text="The Yacht Club" image="img/yacht.png" onClick="showFake()" />
<item text="-" />
<item id="M8" text="City Hall Tower" image="img/camera2.png" onClick="showFake()" />
<item id="M9" text="%C5SS bridge" image="img/yacht2.png" onClick="showFake()" />
<item id="M10" text="Where I work" image="img/work.png" onClick="showFake()" />
<item text="-" />
<item id="M11" text="My home" image="img/home.png" onClick="showFake()" />
<item id="M12" text="The Yacht Club" image="img/yacht.png" onClick="showFake()" />
</menuItems>
</spotmenu>
Version history: