new Drag(displayObject)
Drag manager module
Parameters:
Name | Type | Description |
---|---|---|
displayObject |
FORGE.DisplayObject | The display object concerned by the drag. |
- Source:
- To Do:
-
- work also with rectangle for constrain
Extends
Members
(readonly) alive :boolean
Get the alive flag value of the object.
Type:
- boolean
- Inherited From:
- Source:
alpha :number
Get and set the alpha of the display object during drag
Value can be between 0 and 1.
Type:
- number
- Default Value:
- 1
- Source:
axis :string
Get and set the axis constrains.
Values can be "x" or "y".
To disable axis constrain, you can set an empty string or anything else.
Values can be "x" or "y".
To disable axis constrain, you can set an empty string or anything else.
Type:
- string
- Default Value:
- "empty string"
- Source:
(readonly) className :string
Get the class name of the object.
Type:
- string
- Inherited From:
- Source:
data :*
Get and set any custom data you want to associate to this object.
Type:
- *
- Inherited From:
- Source:
debug :boolean
Get and set the debug flag.
Type:
- boolean
- Inherited From:
- Source:
(readonly) dragging :boolean
Dragging flag for the drag module
Type:
- boolean
- Source:
enabled :boolean
Enabled flag for the drag module
Type:
- boolean
- Default Value:
- false
- Source:
(readonly) onDestroy :FORGE.EventDispatcher
Get the onDestroy FORGE.EventDispatcher, this event is emitted at the end of the destroy sequence.
Type:
- Inherited From:
- Source:
(readonly) progress :Object
Get the progress of the drag position on its contrain on two axes.
If no constrain, this wiil return undefined.
If no constrain, this wiil return undefined.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
x |
number |
<optional> |
The progress on x axis between 0 and 1. |
y |
number |
<optional> |
The progress on y axis between 0 and 1. |
- Source:
revert :boolean
Get and set the revert flag.
If revert is at true, the display object will revert its position to its original position after the drag stop.
Type:
- boolean
- Default Value:
- false
- Source:
revertDuration :number
Get and set the revert duration in milliseconds
Type:
- number
- Default Value:
- 200
- Source:
revertEasing :function
Get and set the revert easing method
Type:
- function
- Default Value:
- FORGE.Easing.LINEAR
- Source:
(readonly) reverting :boolean
Reverting flag for the drag module
Type:
- boolean
- Source:
(readonly) tags :Array
Get the tags associated to this object.
Type:
- Array
- Inherited From:
- Source:
(readonly) uid :string
Get the uid of the object.
Type:
- string
- Inherited From:
- Source:
warning :boolean
Get and set the warning flag.
Type:
- boolean
- Inherited From:
- Source:
Methods
(static) disable()
Disable the drag on its display object
- Source:
(static) enable()
Enable the drag on its display object
- Source:
destroy()
Destroy sequence
- Overrides:
- Source:
log(value)
Basic log method, log a string in the console if debug is enabled.
Parameters:
Name | Type | Description |
---|---|---|
value |
* | The value you want to log in the console. |
- Inherited From:
- Source:
warn(valuenullable)
Basic warn method, log a warn string in the console if warning is enabled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
string | Object |
<nullable> |
The value you want to warn in the console. |
- Inherited From:
- Source: