GDP Functions


Position

Rotation

Scale

Collision

Appearance

Timers

Animation

Attributes

Miscellaneous

Scale

.scaleX() and .scaleY()

The functions .scaleX() and .scaleY() can be used to scale an object's x and y components. The functions can also be used to return and object's current scale. .scaleX() and .scaleY() take in one parameter, and object's desired scale.

object.scaleX(10);    
//scales 'object' in the x direction, with a factor of 10
var scale = object.scaleY();
//sets variable 'scale' to the y scale of 'object'

See Further:

  1. Meteors Part 2

.height() and .width()

The functions .height() and .width() can set an object's dimensions. .width() sets and object's x dimension, while .height() sets an object's y dimension. The functions take in one parameter, and object's desired dimension. These functions can also return an object's current dimension.

object.width(10);    
//sets the width of 'object' to 10;
var height = object.height();
//sets variable 'height' to the height of 'object'

See Further:

  1. Space Bumpers