Difference between revisions of "GUIDragItem"

From Virtual World Web Wiki
Jump to: navigation, search
(Documentation for the GUIDragItem class)
(Documentation for the GUIDragItem class)
Line 1: Line 1:
A UI component designed to be dragged and dropped
 
 
 
*'''Inherits class: [[GUIComponent]]'''
 
*'''Inherits class: [[GUIComponent]]'''
 
* This is a JavaScript visible object
 
* This is a JavaScript visible object
Line 8: Line 6:
 
===Properties===
 
===Properties===
 
:{{CSharp|bool AllowDrag {get; set;} }}
 
:{{CSharp|bool AllowDrag {get; set;} }}
::
 
::Can we drag this DragItem?
 
  
 
:{{CSharp|bool AllowUIDrop {get; set;} }}
 
:{{CSharp|bool AllowUIDrop {get; set;} }}
::
 
::Is this object supposed to drop onto the UI?
 
  
 
:{{CSharp|bool AllowWorldDrop {get; set;} }}
 
:{{CSharp|bool AllowWorldDrop {get; set;} }}
::
 
::Is this object supposed to drop into the world?
 
  
 
:{{CSharp|Color32 DisabledColor {get; set;} }}
 
:{{CSharp|Color32 DisabledColor {get; set;} }}
::
 
::Color tint for the texture when disabled
 
  
 
:{{CSharp|GUISprite DraggingTexture {get;} }}
 
:{{CSharp|GUISprite DraggingTexture {get;} }}
::
 
::Reference to texture that displays when dragging
 
  
 
:{{CSharp|bool Enabled {get; set;} }}
 
:{{CSharp|bool Enabled {get; set;} }}
 +
 
:{{CSharp|bool HideWhenNotDragging {get; set;} }}
 
:{{CSharp|bool HideWhenNotDragging {get; set;} }}
::
 
::Whether to hide the NormalTexture image (allows us to make a dragging image "appear" out of text or other components)
 
  
 
:{{CSharp|Color32 HoverColor {get; set;} }}
 
:{{CSharp|Color32 HoverColor {get; set;} }}
::
 
::Color tint for the texture when hovering the mouse over it
 
  
 
:{{CSharp|Color32 NormalColor {get; set;} }}
 
:{{CSharp|Color32 NormalColor {get; set;} }}
::
 
::Color tint for the texture
 
  
 
:{{CSharp|GUISprite NormalTexture {get;} }}
 
:{{CSharp|GUISprite NormalTexture {get;} }}
::
 
::Reference to texture that displays normally
 
  
 
:{{CSharp|Color32 PressedColor {get; set;} }}
 
:{{CSharp|Color32 PressedColor {get; set;} }}
::
 
::Color tint for the texture when pressed
 
  
 
:{{CSharp|bool SnapToMouse {get; set;} }}
 
:{{CSharp|bool SnapToMouse {get; set;} }}
::
 
::Center the dragging image on the mouse, rather than preserve its original offset while dragging
 
  
 
:{{CSharp|JSVector3 WorldDrop {get;} }}
 
:{{CSharp|JSVector3 WorldDrop {get;} }}
::
 
::Raycasted location in world space where the drag item was released
 
  
 
===Events===
 
===Events===
 
:{{CSharp|OnClick()}}
 
:{{CSharp|OnClick()}}
::
 
::Event fired when the drag item is clicked on without dragging
 
  
 
:{{CSharp|OnDrop()}}
 
:{{CSharp|OnDrop()}}
::
 
::Event fired when the drag item is released after a drag
 
  
 
__NOTOC____NOEDITSECTION__
 
__NOTOC____NOEDITSECTION__

Revision as of 12:49, 26 May 2017

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

Remarks [edit]

Properties

bool AllowDrag {get; set;}
bool AllowUIDrop {get; set;}
bool AllowWorldDrop {get; set;}
Color32 DisabledColor {get; set;}
GUISprite DraggingTexture {get;}
bool Enabled {get; set;}
bool HideWhenNotDragging {get; set;}
Color32 HoverColor {get; set;}
Color32 NormalColor {get; set;}
GUISprite NormalTexture {get;}
Color32 PressedColor {get; set;}
bool SnapToMouse {get; set;}
JSVector3 WorldDrop {get;}

Events

OnClick()
OnDrop()