Skip to content

Layer.scalexy

Terry Cavanagh edited this page Feb 28, 2018 · 1 revision
Layer.scalexy(layername:String, xscale:Float, yscale:Float, [pivotx = 0, pivoty = 0]);

Scales a layer horizontally and vertically. Default is 1 for both. This is the same as calling both Layer.scalex and Layer.scaley separately. If you want to scale evenly, use Layer.scale instead.

  • layername: The name of the layer to check.
  • xscale: Amount to scale the layer horizontally. 1.0 is normal size.
  • yscale: Amount to scale the layer vertically. 1.0 is normal size.
  • pivotx/pivoty: Optional. Specify the pivot point to scale around. Default is top left. Can use Gfx.CENTER, Gfx.TOP, Gfx.BOTTOM, Gfx.LEFT and Gfx.RIGHT constants here.

Example:

See Layer.scalex and Layer.scaley for examples.

Clone this wiki locally