Skip to content

Instantly share code, notes, and snippets.

@codepaladin
Created July 18, 2014 20:57
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/efa4c3b68ba5c110cdfa to your computer and use it in GitHub Desktop.
Save codepaladin/efa4c3b68ba5c110cdfa to your computer and use it in GitHub Desktop.
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