Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop5:behaviors:draggable [2018/10/13 23:29]
valiant_curiosity [Draggable Object Behavior]
gdevelop5:behaviors:draggable [2019/09/16 23:00] (current)
4ian [Add the Draggable behavior to an object]
Line 5: Line 5:
 </​note>​ </​note>​
  
-The draggable object behavior will make the object draggable with the mouse or by touching ​the touchscreen of device. +The draggable object behavior will make the object draggable with the mouse or by touching ​it on touchscreen.
-==== Add draggable behavior to an object ==== +
-To add draggable behavior to an object, first create and object or open the object'​s ​ properties by accessing the object in the Scene Objects list. Select "Edit object"​ from the popup list. Then select "​Behaviors"​ and click the add behavior button+
  
-{{ :​gdevelop5:​behaviors:​addbehavior.jpg?​600 |}}+## Add the Draggable behavior to an object
  
 +To add the Draggable behavior to an object, start with creating an object or open the object'​s properties by accessing the object in the Scene Objects list. Select "Edit object"​ from the popup list. Then select "​Behaviors"​ and click the add behavior button. ​
  
-{{ :​gdevelop5:​behaviors:​draggablebehaviorlistchoice.jpg?600 |}}+{{ :​gdevelop5:​behaviors:​addbehavior.jpg |}}
  
 +Choose the behavior in the list:
  
-==== Draggable object ==== 
 {{ :​gdevelop5:​behaviors:​draggable-object-behavior-inlist.png?​nolink |}} {{ :​gdevelop5:​behaviors:​draggable-object-behavior-inlist.png?​nolink |}}
-By selecting the Draggable object behavior from the list, we can add the functionality to the object. 
-This behavior has no options to change. It automatically applies to the object. 
  
-Using "​Events"​ on the Scene Events tab, we can check to see if an object is being dragged.+## Properties and events
  
-{{:​gdevelop5:​behaviors:​eventcondtiondraggableobject.png|}}+This behavior has no options to change. It automatically applies to the object(s) having it. 
 +Using the events, you can still disable or reactivate this behavior for some objects - if you want to enable the player to move only some objects or restrict this to be done during a particular moment.
  
 +Using events, you can also check if an object is being dragged:
  
 +{{:​gdevelop5:​behaviors:​eventcondtiondraggableobject.png |}}
  
  
-#​Examples ​+# Examples ​
  
 <note tip>​**See it in action!** 🎮\\ <note tip>​**See it in action!** 🎮\\
Line 34: Line 34:
 **Snap to Grid** **Snap to Grid**
  
-{{:​gdevelop5:​behaviors:​snaptogrid.png?400|}}+{{ :​gdevelop5:​behaviors:​snaptogrid.png | }}
  
-https://​editor.gdevelop-app.com/?​project=example://​snap-object-to-grid+ https://​editor.gdevelop-app.com/?​project=example://​snap-object-to-grid
  
 **Shoot Bullet in Parabola Pattern** (A parabola is a plane curve which is mirror-symmetrical and is approximately U-shaped. Basically, an object that shoots toward an object in a curved trajectory.) **Shoot Bullet in Parabola Pattern** (A parabola is a plane curve which is mirror-symmetrical and is approximately U-shaped. Basically, an object that shoots toward an object in a curved trajectory.)
  
-{{:​gdevelop5:​behaviors:​shootbulletparabolapattern.png?400|}}+{{ :​gdevelop5:​behaviors:​shootbulletparabolapattern.png | }}
  
 * https://​editor.gdevelop-app.com/?​project=example://​shoot-bullet-in-parabola * https://​editor.gdevelop-app.com/?​project=example://​shoot-bullet-in-parabola
Line 46: Line 46:
 **Save and Load** **Save and Load**
  
-{{:​gdevelop5:​behaviors:​saveandloadexample.png?400|}}+{{ :​gdevelop5:​behaviors:​saveandloadexample.png | }}
  
 * https://​editor.gdevelop-app.com/?​project=example://​save-load * https://​editor.gdevelop-app.com/?​project=example://​save-load
Line 52: Line 52:
 **Path Finding Basics** **Path Finding Basics**
  
-{{:​gdevelop5:​behaviors:​pathfindingbasics.png?400|}}+{{ :​gdevelop5:​behaviors:​pathfindingbasics.png | }}
  
 * https://​editor.gdevelop-app.com/?​project=example://​pathfinding-basics * https://​editor.gdevelop-app.com/?​project=example://​pathfinding-basics
- 
- 
-