view-types/Spout Views
Spout Views
Spout views were added in ScrollingMenuSign v0.9. If your server is running Spout and you are using the Spoutcraft client, then menus can be displayed on popup Spout views.
Permissions
To do anything with spout views, you must have the scrollingmenusign.use.spout permission node in addition to any other nodes needed for menu/view manipulation. E.g. to add (/sms sync) a spout view to an existing menu, you'll need scrollingmenusign.use.spout and scrollingmenusign.commands.sync. By default, non-op players do not have scrollingmenusign.use.spout - you can give this node to players directly, or give them scrollingmenusign.admin or scrollingmenusign.poweruser. See Permissions for more information.
Creating a Spout View
To create a Spout view, the menu for it must already exist. Then:
/sms sync <menu-name> -spout
This will create the view and give you the view's name. You will need this name to do anything useful with the view - read on...
Using a Spout View
There are three ways to display a Spout view:
- Assign a hotkey (or hotkey combination) to the view with
/sms view <view-name> spoutkeys <key-definition>
. When any user presses the key(s), the view is popped up (or down). - As a menu command, use the special command
POPUP <view-name>
. See Submenus. - Use the command
/sms view <view-name> -popup
. This has been superceded by the above POPUP command but is still supported for backwards compatibility.
The key definitions used are taken from Spout's Keyboard enum - you can use any of the values listed on that page. You can require multiple keys to be pressed simultaneously by separating the key definitions with a '+' sign. Case is not sensitive, and you can omit the KEY_ prefix if you want. E.g. these are all accepted:
/sms view mymenu-1 spoutkeys o /sms view mymenu-1 spoutkeys KEY_O /sms view mymenu-1 spoutkeys lctrl+o /sms view mymenu-1 spoutkeys KEY_LCTRL+KEY_O
Once the view is popped up, items can be selected as follows:
- Click the button for the menu item you want to use.
- Use the standard Spout key bindings (default: Cursor-up, Cursor-down, Return) to scroll the menu and execute the selected item (which is always the top item in the view, highlighted by a yellow "<" marker). Note that these bindings work for other view types too (e.g. sign views, map views...). They can be configured in the configuration file.
- If the list of items is too large to fit the screen, you can scroll it with the scrollbar on the right, or with the mouse wheel.
To pop a Spout view down, just press the view's defined hotkey(s) again, or press Escape.
Removing a Spout View
To delete a Spout view:
/sms break <view-name>
(This works for any view type, not just Spout views)
Cascading Spout Views
See Submenus.
Eye Candy
Spout views offer much more than other views in the way of visual appearance. It is possible to set the background colour, alpha (transparency) and background texture of Spout views on a per-view basis. This is done via the background, alpha and texture attributes of the Spout view. An example:
/sms sync mymenu -spout (let's say the view name is mymenu-1) /sms view mymenu-1 background c0c0ff /sms view mymenu-1 alpha 0.3 /sms view mymenu-1 texture http://some.webserver.com/images/nice-texture-1.png
This will give the view a background texture using the given PNG file, and it will tint the texture to a pale blue colour (an alpha of 0.3 makes the background colour mostly transparent). If you want to have the texture unchanged, just set the alpha to 0.
Some notes:
- The list text (foreground) colour is automatically chosen based on the background colour - pale colours will have a black foreground, dark colours will have a white foreground.
- If you use a texture with a pale background, set the view's background colour to a pale colour too, to force the list text to be black. You can set the alpha to 0 if you don't want the texture tinted.
- Texture files must be in PNG format and their dimensions must be a power of 2, e.g. 128x128, 64x128, 256x256. Textures are scaled, not tiled. Larger textures (256x256 or above) will look best.
- Spout can be somewhat picky about what images it will display, even after you've ensured the dimensions are OK. If you set a texture and it's silently ignored, check your Spoutcraft (client) log file - it's possible that an error about loading the image has been logged there.
Attributes
See Usage/Managing Views for information on viewing and changing view attributes.
Spout views support the following attributes:
Attribute Name | Description | Default |
---|---|---|
owner | The name of the owning player. | Player who created the view |
access | Access control for the view; one of ANY, OWNER, or GROUP | ANY |
spoutkeys | The key or key combination to pop this view up. See above for accepted key syntax. | no keybinding |
autopopdown | If this is set to true, the view will pop down as soon as any item is selected. If false, the view will stay up until dismissed by pressing either the defined key(s) for the view (see spoutkeys attribute) or Escape | true |
background | The background colour for the view. This must be a 6-character hex string in RRGGBB format, e.g. fffff is white, 000000 is black, c0c0ff is pale blue... | Global spout.list_background configuration setting |
alpha | The alpha (transparency) level for the view. This is a floating point number between 0.0 (transparent) and 1.0 (opaque) | Global spout.list_alpha configuration setting |
Comments