Skip to content

Instantly share code, notes, and snippets.

@codepaladin
Last active August 29, 2015 14:00
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/11145921 to your computer and use it in GitHub Desktop.
Save codepaladin/11145921 to your computer and use it in GitHub Desktop.
Jumper - Draw Start and End
-- draw start position by using the pixel coordinates
-- set the startx and starty grid coordinates
function drawStart(xyPixelCoordinate, xyGridCoordinate)
local myText = display.newText( "A", xyPixelCoordinate.x, xyPixelCoordinate.y, native.systemFont, 34 )
myText:setFillColor( 255, 255, 255 )
startx = xyGridCoordinate.x
starty = xyGridCoordinate.y
end
-- draw end position by using the pixel coordinates
-- set the endx and endy grid coordinates
function drawEnd(xyPixelCoordinate, xyGridCoordinate)
local myText = display.newText( "B", xyPixelCoordinate.x, xyPixelCoordinate.y, native.systemFont, 34 )
myText:setFillColor(255, 255, 255 )
endx = xyGridCoordinate.x
endy = xyGridCoordinate.y
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment