Skip to content

Instantly share code, notes, and snippets.

@walterlua
walterlua / config.lua
Created Oct 22, 2014
Adaptive Content Scaling in Corona for resolution-independent UI
View config.lua
application =
{
content =
{
scale = "adaptive",
fps = 60,
imageSuffix =
{
["@2x"] = 1.5,
@walterlua
walterlua / build.settings
Last active Aug 29, 2015
Updated build.settings to show how to satisfy Apple's new plist requirement of "CFBundleShortVersionString" for app submission (based on Corona's HelloWorld sample)
View build.settings
settings =
{
orientation =
{
default = "portrait",
supported = { "portrait" }
},
iphone =
{
plist =
@walterlua
walterlua / test.lua
Last active Jan 2, 2016
test #coronasdk
View test.lua
-- #coronasdk
print( "hello" )
@walterlua
walterlua / gist:7556165
Last active Dec 28, 2015
AndroidManifest.xml for OpenGL-ES 2 #coronasdk
View gist:7556165
<uses-feature android:glEsVersion="0x00020000"/>
@walterlua
walterlua / gist:3937293
Last active Oct 11, 2015
Detecting when webviews have finished loading #coronasdk
View gist:3937293
local function onWebViewEvent(event)
if "loaded" == event.type then
print("Finished loading: ", event.url )
end
end
local webView = native.newWebView( 0, 0, 500, 400 )
webView:addEventListener("urlRequest", onWebViewEvent)
webView:request("http://www.coronalabs.com")
@walterlua
walterlua / build.settings
Created Oct 9, 2012
Corona: iOS 6, GameCenter, Landscape workaround
View build.settings
settings =
{
orientation =
{
default = "landscapeRight",
supported =
{
"landscapeRight",
"landscapeLeft",
},
@walterlua
walterlua / gist:3816630
Created Oct 2, 2012
Workaround for Nook HD bug
View gist:3816630
-- Workaround for Nook HD bug
local listener = function( event )
if "applicationResume" == event.type then
display.currentStage.alpha = 0.9
-- Force invalidate 1 second after resume
timer.performWithDelay( 1000, function()
display.currentStage.alpha = 1.0
end)
end
@walterlua
walterlua / build.settings
Created Sep 21, 2012
Corona and iOS custom url schemes test case
View build.settings
settings = {
iphone =
{
plist =
{
CFBundleIconFile = "Icon.png",
CFBundleIconFiles = {
"Icon.png",
"Icon@2x.png",
"Icon-72.png",
@walterlua
walterlua / gist:3726123
Created Sep 15, 2012
Corona iPhone 5 tall app detection
View gist:3726123
local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )
@walterlua
walterlua / gradient.lua
Created Sep 7, 2011
Gradient on text demo in Corona SDK
View gradient.lua
local myText = display.newText( "Hello, World!", 0, 0, native.systemFont, 40 )
myText.x = display.contentWidth * 0.5
myText.y = display.contentWidth * 0.25
local g = graphics.newGradient( { 255, 255, 0 }, { 200 }, "down" )
myText:setTextColor( g )
You can’t perform that action at this time.