object.maskScaleX

Type Number
Object DisplayObject
Library display.*
Revision Release 2022.3683
Keywords image mask, masking, clipping, bit mask
See also object.maskScaleY

Overview

Retrieve or set the x-scale factor for the display object's corresponding mask object, if any.

Gotchas

Increasing this value above 1.0 will increase the masked object's content width (object.contentWidth).

Example

-- Image to be masked
local image = display.newImageRect( "image.png", 768, 1024 )
 
-- Mask
local mask = graphics.newMask( "circlemask.png" )
image:setMask( mask )
image.maskScaleX = 0.5
image.maskScaleY = 0.5