Skip to content

Instantly share code, notes, and snippets.

@walterlua
walterlua / config.lua
Created October 22, 2014 01:44
Adaptive Content Scaling in Corona for resolution-independent UI
application =
{
content =
{
scale = "adaptive",
fps = 60,
imageSuffix =
{
["@2x"] = 1.5,
@walterlua
walterlua / build.settings
Last active August 29, 2015 14:05
Updated build.settings to show how to satisfy Apple's new plist requirement of "CFBundleShortVersionString" for app submission (based on Corona's HelloWorld sample)
settings =
{
orientation =
{
default = "portrait",
supported = { "portrait" }
},
iphone =
{
plist =
@walterlua
walterlua / test.lua
Last active January 2, 2016 02:09
test #coronasdk
-- #coronasdk
print( "hello" )
@walterlua
walterlua / gist:7556165
Last active December 28, 2015 20:19
AndroidManifest.xml for OpenGL-ES 2 #coronasdk
<uses-feature android:glEsVersion="0x00020000"/>
@walterlua
walterlua / gist:3937293
Last active October 11, 2015 23:37
Detecting when webviews have finished loading #coronasdk
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 October 9, 2012 05:56
Corona: iOS 6, GameCenter, Landscape workaround
settings =
{
orientation =
{
default = "landscapeRight",
supported =
{
"landscapeRight",
"landscapeLeft",
},
@walterlua
walterlua / gist:3816630
Created October 2, 2012 06:06
Workaround for Nook HD bug
-- 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 September 21, 2012 02:17
Corona and iOS custom url schemes test case
settings = {
iphone =
{
plist =
{
CFBundleIconFile = "Icon.png",
CFBundleIconFiles = {
"Icon.png",
"Icon@2x.png",
"Icon-72.png",
@walterlua
walterlua / gist:3726123
Created September 15, 2012 02:31
Corona iPhone 5 tall app detection
local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )
@walterlua
walterlua / gradient.lua
Created September 7, 2011 23:19
Gradient on text demo in Corona SDK
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 )