Last active
August 29, 2015 14:13
-
-
Save codepaladin/c2d7921dd50d23898683 to your computer and use it in GitHub Desktop.
Path Masking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local path = display.newImage( "Images/WorldMap/path/level2.png") -- base image (yellow line) | |
local mask = graphics.newMask( "Images/WorldMap/path/level2-mask-0.jpg" ) -- base mask (completely black) | |
path:setMask( mask ) | |
local ctr = 0 | |
local iterations = 38 -- number of mask images in animation sequence | |
local function mask( event ) | |
ctr = ctr + 1 | |
path:setMask( nil ) -- remove the previous mask | |
local mask = graphics.newMask( "Images/WorldMap/path/level2-mask-"..ctr..".jpg" ) -- draw the next mask | |
path:setMask( mask ) | |
end | |
timer.performWithDelay( 100, mask, iterations ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment