Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_dragdrop2

Plugin, ACE table, Discussion thread
Dependence: rex_touchwrap plugin

Introduction
Drag and drop this object.
This behavior is almost the same as official drag drop behavior.

Usage
Sample capx
Prepare
Remember to put rex_touchwrap plugin into project.
Enable
Set "Activated" to "Yes" to enable dragging. "Condition:Is enabled" will return true if enabled.
Drag and drop object
Drag and drop object by touch or mouse, it is the same as official drag drop behavior. There is some additional features in this behavior.
Dragging moving
"Condition:On dragging moving start" or "Condition:On dragging moving end" will be triggered when dragging moving start or stop(moving end). "Condition:Is dragging moving" will return true when dragging moving.
Position of object at dragging start
The position of object at dragging start could be got by "Expression:InstStartX" and "Expression:InstStartY". These are useful when the object needs to move back to it's original position.
Dragging point
User could get the beginning of  dragging point by "Expression:DragStartX" and "Expression:DragStartY". And get current dragging point by "Expression:X", and "Expression:Y" ( or "Expression:AbsoluteX", and "Expression:AbsoluteY" ). So that user could calculate the dragging vector by these data.
Drag distance and drag angle
Drag distance is the distance between current touch position to drag-start position, which could be got by "Expression:DragDistance". Or compare this value by "Condition:Compare drag-distance".
Drag angle is the angle of dragging, which could be got by "Expression:DragAngle". Or compare this value by "Condition:Compare drag-angle".
Try drag
Sample capx
"
Action:Try drag" could force this object trying to be dragged if there has a touch point above.
Axis angle
Sample capx
Property "Axis angle" is an offset angle of axis if the property "Axis" sets to "Horizontal" or "Vertical". Or sets this property by "Action:Set angle".

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About