Skip to content

Instantly share code, notes, and snippets.

@codepaladin
Created January 14, 2015 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codepaladin/2ba72935cd2d26b4361b to your computer and use it in GitHub Desktop.
Save codepaladin/2ba72935cd2d26b4361b to your computer and use it in GitHub Desktop.
Image Transitioning and Masking
local group = display.newGroup()
group:translate(display.contentCenterX, display.contentCenterY) -- move the group to the center of the screen
local baseImage = display.newImage(group, "base-image.png") -- draw the yellow circle image & add to group
local mask = graphics.newMask('example-mask.png') -- draw a mask
group:setMask(mask) -- set the mask on the group
transition.to( baseImage, { time=1000, x=180 } ) -- move the image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment