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