Wednesday, January 31, 2007

UIPane

UIPane is the generic 'container' for other UI Objects. Panes can't be rendered, but they can contain 'child' objects which can be renderable objects.

Every scene has a 'rootpane', which is automatically defined by the engine when a new UIScene is loaded from a XML file.

Child objects within a pane will be positioned with their x,y origin relative to the origin of the UI Pane that contains the child. UIPanes can also simulate buttons with the tupple attribute, so many of the attributes for UIPane are similar to those found under UIButton.

The following attributes are supported by UI Pane:

MouseDownSFX
Sound effect to be played when the Pane is clicked on. This only means anything if the Pane is a tupple style pane.

MouseUpSFX
Similar to a button up sound effect, this only means anything if the Pane is a tupple style pane.

MouseDragSFX
Sound effect for dragging a tupple style UI Pane object.

MouseDropSFX
Sound effect when releasing a dragged tupple style UI Pane object.

tupple
Setting this attribute to true makes the entire UI Pane behave like a button rather than just a container. This makes it possible to design more complicated buttons than normal, default UIButton tag allows for such as having a defined layout or multiple icons within the same button, etc. Once a Pane becomes a tupple, it can be clicked on, gain focus, lose focus, become enabled, become disabled, etc., just like a normal button. Note that it is still possible to place buttons within a tupple style pane that should work fine. So you could have a listbox row that is a tupple style pane that also has a toggle button on every row, for example.

OnLeftClick
The callback to be executed when a tupple style UI Pane is left clicked on.

OnLeftDoubleClick
The callback to be executed when a tupple style UI Pane is double left clicked on.

OnRightClick
The callback to be executed when a tupple style UI Pane is right clicked on.

OnRightDoubleClick
The callback to be executed when a tupple style UI pane is double right clicked on.

No comments: