Created
July 18, 2014 20:57
-
-
Save codepaladin/efa4c3b68ba5c110cdfa to your computer and use it in GitHub Desktop.
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
function zIndexCharacters() | |
local function redraw() | |
-- images are all held in an allImages array | |
for image = 1, #allImages do | |
allImages[image]:toBack() | |
end | |
end | |
local function compare( a, b ) | |
return a.y > b.y | |
end | |
table.sort(allImages, compare ) | |
redraw() | |
end | |
Runtime:addEventListener( "enterFrame", zIndexCharacters ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment