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 to get the New Height for Given Width | |
function getNewHeight(image , newWidth) | |
local r = image.width / image.height --4 | |
local newHeight = newWidth / r --5 | |
return newHeight --6 | |
end | |
--Function to get the New Width for Given Height | |
function getNewWidth(image , newHeight) | |
local r = image.width / image.height |
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
local iosNetworkAvailable = true -- 1 | |
function networkListener( event ) | |
iosNetworkAvailable = event.isReachable | |
end | |
if ( network.canDetectNetworkStatusChanges ) then | |
network.setStatusListener( "www.apple.com",networkListener ) -- 2 | |
end |
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
if isRechable() == true then | |
-- Network is Available Here. Do Something | |
else | |
-- Network is Not Available Here. | |
native.showAlert( "No Internet","It seems internet is not Available. Please connect to internet.", { "OK" } ) | |
end |
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
local myVariable1 = "SOME_CONSTANT_VALUE" | |
local myVariable2 = "SOME_CONSTANT_VALUE" | |
local M = {} | |
function M.myAwesomeFunction1() | |
-- Do something here and return the value | |
end | |
function M.getMyVariable1() |
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
local utility = require "utility" | |
local anyVariable = utility.myAwesomeFunction1() | |
local myVariable1 = utility.getMyVairable1() |
OlderNewer