Skip to content

Transformable

Isuru Kusumal Rajapakse edited this page Jun 17, 2017 · 1 revision

new Transformable()

  • Represents a component that defines a behaviors like transform, center etc.
Returns
  • Void

Transformable.transform(width, height)

transform the object to the given scale

Parameters
Name Type Description
width int - desired width.  
height int - desired height.  
Returns
  • Void

Transformable.resize(byX, byY)

transform the object to the given scale

Parameters
Name Type Description
byX int - increse/decrease in width.  
byY int - increse/decrease in height.  
Returns
  • Void

Transformable.center([x=width/2, y=height/2])

sets the origin of the object to the given position if called without parameters, it defaults to center of the object

Parameters
Name Type Description
x=width/2 int - anchor in the x position. Optional
y=height/2 int - anchor in the y position. Optional
Returns
  • Void

Clone this wiki locally