Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block Foxbyte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Foxbyte / simple grid
Created Mar 10, 2014
A simple grid to create columns in your Corona SDK project.
View simple grid
-- Screen size
local screenW, screenH, halfW, halfH = display.viewableContentWidth, display.viewableContentHeight, display.viewableContentWidth*0.5, display.viewableContentHeight*0.5
-- Grid
numberOfColumns = 16
columnWidth = math.floor( screenW / numberOfColumns )
function getColumnPosition( columnNumber )
return (columnNumber - 1) * columnWidth
function getColumnWidth( numberOfColumns )
Foxbyte / test.lua
Last active Nov 21, 2019
CORONA LUA CODE: Calculate distance between 2 points and sort points (longitude, latitude) by your 'GPS position'
View test.lua
function print_r ( t )
local print_r_cache={}
local function sub_print_r(t,indent)
if (print_r_cache[tostring(t)]) then
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
View Corona SDK - update GPS
local currentLatitude = 0
local currentLongitude = 0
local updateGps = 5000 -- update Gps every X seconds
local locationHandler = function( event )
-- On update, stop listening to GPS signal to avoid battery draining
Runtime:removeEventListener( "location", locationHandler )
-- Check for error (user may have turned off Location Services)
if event.errorCode then
You can’t perform that action at this time.