spotmenu.swf
FPP hotspot plugin for displaying a scrollable menu box.Each menu item can have an icon and OnClick, OnOver and OnOut events.
You can have as many menus as you like in your pano.
The plugin reads configuration data from an external XML file.
Plugin parameters are read from an external xml file with the default name "spotmenu.xml". If you
want to use a different name, use the xmlFile="..." attribute. And whenever this attribute is changed,
the plugin will load and build a new menu.
Menu commands can be executed by setting the action="..." attribute (example: action="select=M5").
The following actions are supported:
Example menu <spot>:
Tags and attributes used in plugin XML file:
NOTES: Parameter and attribute names are not case sensitive ("bgcolor" is equal to "BGColor"). If a background image larger than the menu is used, 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" parameter can be used at any time to simulate an menu item click. The onClick command will be executed and the menu will be hidden if "hideOnClick" is set. The "select=xxx" parameter can also be used to select a menu item. But the onClick command will NOT be executed and the menu will NOT be automatically hidden. If the "id" attribute is not specified for menu items, the value of the "click" and "select" parameters will be matched against the menu item "text" attribute.
Example of plugin xml file:
Version history:
The following actions are supported:
| click | click=M8 | simulate menu item click, onClick command will be executed |
| select | select=M5 | set this menu item as selected, onClick command will NOT be executed |
| hide | hide=T | 0 or 1, anything else will toggle menu state |
| show | show=T | as "hide" parameter, but inverted |
| enable | enable=MI1 | enable menu item |
| disable | disable=MI1 | disable menu item |
| item_id | L5=global.showPano5 | set onClick command |
<spot id="menu3" url="../spotmenu.swf" static="1" salign="BC" align="BC" staticX="-100" staticY="-10" alpha="1" visible="1" mouseChildren="1" blockMouse="1" disableKeys="0" disableControls="0" onOver="pano.disableWheel=1; pano.disableKeys=1;" onOut="pano.disableWheel=0; pano.disableKeys=0" xmlFile="menu23.xml" />
Tags and attributes used in plugin 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 |
| heading | heading="My FPP menu" | menu heading, default=no heading |
| itemSpace | itemSpace="5" | extra vertical space between menu items, default=0 |
| showAtStart | showAtStart="1" | show menu at start, default=0 |
| selectMode | selectMode="3" | menu item behaviour after being clicked: (see also under NOTES below) |
| 1 = selected and not clickable (default) | ||
| 2 = selected and clickable | ||
| 3 = not selected and clickable | ||
| hideOnClick | hideOnClick="0" | hide menu after clicking item, default=1 |
| hideStyle | hideStyle="fly,collapse" | menu hiding style, supported values: "", "fly" or "collapse" |
| or combination, default="" | ||
| In <fonts> tag: | ||
| in <heading> childtag:use to set menu heading attributes | ||
| in <item> childtag:use to set menu item attributes | ||
| in <selected> childtag:use to set selected menu item attributes | ||
| in <mouseOver> childtag:use to set mouse-over menu item attributes | ||
| in <disabled> childtag:use to set disabled menu item attributes | ||
| visible | visible="0" | show field with name of chosen thumbnail (default 1) |
| font | font="Helvetica" | menu item text font name |
| textSize | textSize="16" | menu item text size |
| textColor | textColor="#FFFFFF" | menu item text color |
| bgColor | bgColor="#F00000" | menu item text background color |
| borderColor | borderColor="#A0A0C0" | menu item text border color |
| bold | bold="1" | menu item text bold attribute |
| italic | italic="1" | menu item text italic attribute |
| underline | underline="1" | menu item text underline attribute |
| 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 |
| 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 |
NOTES: Parameter and attribute names are not case sensitive ("bgcolor" is equal to "BGColor"). If a background image larger than the menu is used, 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" parameter can be used at any time to simulate an menu item click. The onClick command will be executed and the menu will be hidden if "hideOnClick" is set. The "select=xxx" parameter can also be used to select a menu item. But the onClick command will NOT be executed and the menu will NOT be automatically hidden. If the "id" attribute is not specified for menu items, the value of the "click" and "select" parameters will be matched against the menu item "text" attribute.
Example of plugin xml file:
<?xml version = '1.0'?>
<spotmenu
size="200:240"
bgColor="#FFFFFF-#A0A0A0"
borderColor="#FFFFFF"
itemSpace="2"
heading="My FPP menu 5"
showAtStart="1"
hideOnClick="1"
hideStyle="fly"
>
<fonts>
<heading font="Trebuchet MS" textSize="16" textColor="#FFFFFF" bgColor="#000000" bold="1" />
<item font="Trebuchet MS" textSize="14" textColor="#000000" />
<selected textColor="#000000" bgColor="#FFFFFF" />
<mouseOver textColor="#000000" bgColor="#A0A0A0" borderColor="#000000" bold="1" />
</fonts>
<menuItems>
<item id="M1" text="City Hall Tower" image="img/camera2.png" onClick="global.showFake()" onOver="pic5s.visible=1" onOut="pic5s.visible=0" />
<item id="M2" text="Maria Hill" image="img/camera1.png" onClick="global.showFake()" onOver="pic6s.visible=1" onOut="pic6s.visible=0" />
<item text="-" />
<item id="M3" text="%C5SS bridge" image="img/yacht2.png" onClick="global.showFake()" onOver="pic7s.visible=1" onOut="pic7s.visible=0" />
<item id="M4" text="Where I work" image="img/work.png" onClick="global.showFake()" onOver="pic3s.visible=1" onOut="pic3s.visible=0" />
<item id="M5" text="The Train Bridge" image="img/train.png" onClick="global.showFake()" onOver="pic2s.visible=1" onOut="pic2s.visible=0" selected="1" />
<item text="-" />
<item id="M6" text="My home" image="img/home.png" onClick="global.showFake()" onOver="pic1s.visible=1" onOut="pic1s.visible=0" />
<item id="M7" text="The Yacht Club" image="img/yacht.png" onClick="global.showFake()" onOver="pic4s.visible=1" onOut="pic4s.visible=0" />
<item text="-" />
<item id="M8" text="City Hall Tower" image="img/camera2.png" onClick="global.showFake()" onOver="pic5s.visible=1" onOut="pic5s.visible=0" />
<item id="M9" text="%C5SS bridge" image="img/yacht2.png" onClick="global.showFake()" onOver="pic7s.visible=1" onOut="pic7s.visible=0" />
<item id="M10" text="Where I work" image="img/work.png" onClick="global.showFake()" onOver="pic3s.visible=1" onOut="pic3s.visible=0" />
<item text="-" />
<item id="M11" text="My home" image="img/home.png" onClick="global.showFake()" onOver="pic1s.visible=1" onOut="pic1s.visible=0" />
<item id="M12" text="The Yacht Club" image="img/yacht.png" onClick="global.showFake()" onOver="pic4s.visible=1" onOut="pic4s.visible=0" />
</menuItems>
</spotmenu>
Version history:
1.2:
Added support for disabled menu items.
Added possibility to change menu item onClick command. 1.1.1:
Fixed bug when showAtStart="0".
Fixed bug when checking for new XML file. 1.1:
Added attribute selectMode="n" to control what happens with a menu item after it has been clicked.
Added support for disabled menu items.
Added possibility to change menu item onClick command. 1.1.1:
Fixed bug when showAtStart="0".
Fixed bug when checking for new XML file. 1.1:
Added attribute selectMode="n" to control what happens with a menu item after it has been clicked.
