Created
March 27, 2017 18:34
-
-
Save piXelicidio/8989c1b978f3d12cfeb212518018f42d to your computer and use it in GitHub Desktop.
Corona SDK or Love2D detect
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
-- Dirty trick to detect if Corona SDK or Love ;) | |
-- first time we require this module it will be inialized with the current detected SDK | |
if display~=nil then | |
-- maybe is corona sdk | |
if display.newImage~=nil then | |
-- pretty sure it is | |
print "Running: Corona SDK" | |
api = require('code.coronaapi') | |
end | |
elseif love~=nil then | |
-- maybe is löve | |
if love.graphics~=nil then | |
-- pretty sure it is löve | |
print 'Running: Löve' | |
api = require('code.loveapi') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment