GDP Functions


Position

Rotation

Scale

Collision

Appearance

Timers

Animation

Attributes

Miscellaneous

Collision

.isTouching()

The function .isTouching() will return whether or not and object is in contact with another item. The function takes in one parameter, the object that is being detected.

var bool = object.isTouching(object2);    
//sets variable 'bool' to whether or not 'object' is touching 'object2'

See Further:

  1. Zapper Part 2
  2. Wall Blaster

.toggleDraggable()

The function .toggleDraggable() will change an object's draggability. In other words, if an object is draggable, .toggleDraggable() will make it undraggable. If an object is not draggable, .toggleDraggable() will make it draggable. .toggleDraggable() takes in no parameters.

object.toggleDraggable();    
//changes the draggability of 'object'

See Further:

  1. Ninja Supplies

.draggable()

The function .draggable() sets whether or not an object is draggable. The function takes in one parameter, true or false, to set the draggability. The function can also return whether an object is draggable.

object.draggable(true);    
//makes 'object' draggable

See Further:

  1. Ninja Puzzle