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 [2017/11/19 12:21]
ddabrahim
gdevelop5:behaviors:draggable [2019/05/18 22:33] (current)
piyushpalawat99
Line 1: Line 1:
-## Draggable ​object behavior+# Draggable ​Object Behavior
  
-The draggable object behavior will make the object draggable with the mouse or using the touchscreen of the device.+<note tip>​**See it in action!** 🎮\\ 
 +[[#​Examples|I would rather see the Draggable object behavior examples! Please take me there now.]] 
 +</​note>​ 
 + 
 +The draggable object behavior will make the object draggable with the mouse or by touching ​the touchscreen of device. 
 +==== Add draggable behavior to an object ==== 
 +To add 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:​addbehavior.jpg?​600 |}} 
 + 
 + 
 +{{ :​gdevelop5:​behaviors:​draggablebehaviorlistchoice.jpg?​600 |}}
  
-==== Add behavior to object ==== 
-To add behavior to an object, first open the object properties by right clicking on the object and select Edit object from the list. Then select behaviors and click the add behavior button. ​ 
  
 ==== Draggable object ==== ==== 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. By selecting the Draggable object behavior from the list, we can add the functionality to the object.
-This behavior has no options to change ​and automatically ​apply 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. 
 + 
 +{{:​gdevelop5:​behaviors:​eventcondtiondraggableobject.png|}} 
 + 
 + 
 + 
 + 
 +#Examples  
 + 
 +<note tip>​**See it in action!** 🎮\\ 
 +Open these examples online.</​note>​ 
 + 
 +**Snap to Grid** 
 + 
 +{{:​gdevelop5:​behaviors:​snaptogrid.png?​400|}} 
 + 
 +* 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.) 
 + 
 +{{:​gdevelop5:​behaviors:​shootbulletparabolapattern.png?​400|}} 
 + 
 +* https://​editor.gdevelop-app.com/?​project=example://​shoot-bullet-in-parabola 
 + 
 +**Save and Load** 
 + 
 +{{:​gdevelop5:​behaviors:​saveandloadexample.png?​400|}} 
 + 
 +* https://​editor.gdevelop-app.com/?​project=example://​save-load 
 + 
 +**Path Finding Basics** 
 + 
 +{{:​gdevelop5:​behaviors:​pathfindingbasics.png?​400|}}
  
-Using events we can check if an object is being dragged+* https://​editor.gdevelop-app.com/?​project=example://​pathfinding-basics
  
-==== Examples ==== 
  
-List of examples: 
-  * drag object: [[https://​gametemplates.itch.io/​template-manipulate-text-object|Link]]