HomefieldOfView | SPi-V dev

Legend

  • required
  • not yet implemented

Navigation

user

<uielement>

Description

uielement nodes share a lot of properties with panoelement nodes. The fundamental difference is that while panoelements are projected into panoramic space, uielement nodes are projected into the viewer plane, ie: they are laid over the panoramic scene and don't move with the panoramic camera.

Like panoelement nodes, uielement nodes reference other nodes such as image and behavior nodes.

A scene can have many uielement nodes, optionally grouped in one or more uigroups.

Syntax

<tour>
  <scene>
    <uielement id="elementID" 
      width="128" height="128" 
      halign="center" valign="center" 
      hoffset="0" voffset="0"
      visible="true" enabled="true" zorder="0" blend="100"
      image="someImage" behavior="someBehavior">
      <image />
      <behavior />
    </uielement>

    <uigroup>
      <uielement id="elementID" 
        halign="center" valign="center" 
        image="someImage" behavior="someBehavior"  />
      </uielement>
      ...
    </uigroup>

    <image id="someImage" />
    <behavior id="someBehavior" />
    ...
  </scene>
</tour>

Attributes

  • id
    Unique id to reference the group by.
  • width
    The width of the UI element on screen. If this value is omitted, the pixel width of the referenced image is used.
    Values: either pixel values or a percentage of the element's parent uigroup or viewer width. If a negative value is specified, the element width will be set to the width of the element's parent uigroup or viewer height minus the specified amount.
  • height
    The height of the UI element on screen. If this value is omitted, the pixel height of the referenced image is used.
    Values: either pixel values or a percentage of the element's parent uigroup or viewer height. If a negative value is specified, the element height will be set to the height of the element's parent uigroup or viewer height minus the specified amount.
  • halign
    Specifies the horizontal alignment to the element's parent uigroup or viewer rectangle.
    Values: center, left, right, defaults to center.
  • valign
    Specifies the vertical alignment to the element's parent uigroup or viewer rectangle.
    Values: center, top, bottom, defaults to center.
  • hoffset
    Horizontal offset of the element, specified in pixels. Depending on the halign value, the hoffset is calculated from the center, left or right edge of the image.
    Values: either pixel values or a percentage of the element's parent uigroup.
  • voffset
    Vertical offset of the element, specified in pixels. Depending on the valign value, the voffset is calculated from the center, top or bottom edge of the image.
    Values: either pixel values or a percentage of the element's parent uigroup.
  • rotation
    Sets the rotation along the axis perpendicular to the screen.
    Values: -360 to 360, defaults to 0
  • blend
    Sets the opacity for the element. If blend is set to 0, behaviors attached to the element are still active even though the element is invisible.
    Values: 0 to 100, defaults to 100
  • zorder
    Sets the depth sort order of the element within its uigroup or within the viewer.
    Values: 0 to 9, defaults to 0
  • visible
    Shows/hides all the the element and enabled/disables behaviors associated to it.
    Values: true/false, defaults to true
  • enabled
    Enables/disables behaviors associated to the element
    Values: true/false, defaults to true
  • antialias
    Enables/disables antialiasing for the image associated to this element. uielements may seem a bit blurry when antialias is enabled, but antialiasing greatly improves the quality of the element when it is rotated.
    Values: true/false. Defaults to false
  • catchevents
    Marks the object 'active' for picking, even if it has no behaviors attached to it. This way it blocks other 'active' objects underneath it. Elements that are not marked with catchevents are invisible to the pointer; you 'click through' them even if they fully obscure an active element underneath.
    Values: true/false. Defaults to false

Events

  • enter
    Fires when the pointer is moved over the element.
  • leave
    Fires when the pointer leaves the element
  • press
    Fires when the user presses the mouse button while over the element.
  • release
    Fires when the user releases the mouse button after the press event has fired for this element.
  • ready
    Fires when the elements is done building.

Children

History

  • 04-Dec-07: Added missing rotation attribute
  • 01-Apr-07: Removed references to sound, added catchevents attribute
  • 14-Oct-05: Added events, antialias attribute
  • 06-Jun-05: Updated zorder, blend attributes
  • 8-Jun-04: Removed superfluous src attribute,
    changed width and height values to support percentages and negative values,
    changed offset values to support percentages.
  • 18-Apr-04: Initial version

Typo

vfov="center" should read valign="center" in the first example code.

Ian

Admin: fixed, thanks

Re: <uielement>

  1. Since its children are also atributes (image, behavior and sound), I dont know whether this is in general (for other nodes) true, but it might be nice to mention that fact in the description, or in the atribute list. Not just in the example.
  2. ADD: I came acros an atribute you used in the toolbar scriptlet: catchevents="true", what is the exact use/syntax of this?
    I suppose it does something like tilling the node to use the behavior of the uigroup? Does it also work on the panogoup/-element?

Re: <uielement>

Image and behavior nodes can be used by the uielement either by referencing them as an attribute, or by by including them as a child. The former has prevalence over the latter.

I removed the references to sound nodes, because they turned out to work different than I expected when I wrote this documentation.