Type Function Object DisplayObject Library display.* Return value none Revision 2017.3145 Keywords scale See also object.xScale object.yScale
Effectively multiplies the size of a display object by
yScale respectively. The scaling occurs around the object's anchor point.
Valid examples include
1.0 for 100%,
2.0 for 200%, or
0.5 for 50%.
When a display object is converted into a physics object, scaling the object will change the visual size, but it will not affect how the physics engine regards the object size. This could result in unpredictable results when interacting with other physics bodies.
object:scale( xScale, yScale )
Numbers. Factors by which to change the scale in the x and y directions respectively.
local star = display.newImage( "star.png" ) -- Scale the image by 200% (x) and 50% (y) star:scale( 2, 0.5 )
local star = display.newImage( "star.png" ) -- Flip the image vertically and horizontally star:scale( -1, -1 )