CoronaSDK 2013.1127 | Released: 25 May 2013, 2:00am | What's New | Download Now
These docs are *very* out of date.
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
You will be redirected to the new docs in a few seconds.
If you are certain you want to see the old docs, click cancel.
Cancel | Continue to new docs
object.maskX
Description:
Retrieve or set the x-position of the mask applied to the display object using object:setMask().
Syntax:
1 2 | object.maskX
value = object.maskX |
Example:
This sample moves the mask applied to the corresponding image to the position where the user moves their finger on the display.
-- Image to be masked local image = display.newImageRect( "image.png", 768, 1024 ) image:translate( halfW, halfH ) -- Mask local mask = graphics.newMask( "circlemask.png" ) image:setMask( mask ) function onTouch( event ) local t = event.target local phase = event.phase if "moved" == phase then t.maskX = event.x t.maskY = event.y end end image:addEventListener( "touch", onTouch )
Parameters:
None.
Returns:
number: maskX of object.
Remarks:
Supported on operating systems and platforms for build numbers shown:
- Mac OS X:Build 2011.268
- Windows:Build 2011.288
- iOS:Build 2011.268
- Android:Build 2011.288