GUIWindow

From Virtual World Web Wiki
Jump to: navigation, search

A "standard" window that includes a draggable area, resize features, and a close button

  • Inherits class: GUIBaseWindow
  • This is a JavaScript visible object

Remarks [edit]

Properties

bool AutoDock {get; set;}
bool CanResize {get; set;}
Can the user resize the window?
GUIButton CloseButton {get;}
Reference to the Close Button
bool DestroyOnClose {get; set;}
Should this window destoy itself when the close button is pressed (or just hide)?
int DockStyle {get;}
float DragAreaHeight {get; set;}
The height of the area at the top of the window that allows for dragging
TODO: Replace this with a proper RectTransform
bool Draggable {get; set;}
Allow this window to be dragged
int EdgeSnap {get; set;}
Distance (in pixels) to snap onto the edge of the screen
bool KeepOnscreen {get; set;}
Prevent the user from dragging the window off screen by keeping all 4 corners within the visible area
JSVector2 MaxSize {get; set;}
Specifies a maximum size the window can be resized to
JSVector2 MinSize {get; set;}
Specifies a minimum size the window can be resized to
bool ShowMoveCursor {get; set;}
Should we show the four-way move cursor when the user is over the draggable area?
GUILabel Title {get;}
Reference to the title text of the window

Events

OnClose()
Event fired when the Close button is pressed
OnDragEnd()
Event fired when the user releases the mouse to finish dragging the window
OnDragMove()
Event fired when the user is dragging the window
OnDragStart()
Event fired when the user starts dragging the window
OnFocusChanged(EventHandler<FlexibleEventArgs<bool>>)
OnResizeEnd()
Event fired when the user releases the mouse to end a resize

Methods

void Close()
Trigger the close button's click function (to destroy or hide the window)
void EnsureVisible()
Make sure the window is inside the screen's viewing area
void MoveToScreen(bool snap = false, int? edgeSnap = NULL)
void SetDockStyle(DockStyle dockStyle)
void SetFocus()