Scrappy Device

by Scrappy Ferret

About

Scrappy Device is a simple helper library for Solar2D that simplifies working out what sort of device your app is running on.

API

A full API listing can be found here.

Examples
 

-- Load plugin library
require "plugin.scrappyDevice"

-- Initiate the library
Scrappy.Device:init()

-- What's our platform?
print( "Platform: ", Scrappy.Device:getPlatform() )

-- What's our environment?
print( "Environment: ", Scrappy.Device:getEnvironment() )

-- What's our architecture?
print( "Architecture: ", Scrappy.Device:getArchitecture() )

-- What's our model?
print( "Model: ", Scrappy.Device:getModel() )

-- Are we on a real device?
print( "Real: ", Scrappy.Device:isReal() )

-- Are we in the simulator?
print( "Simulator: ", Scrappy.Device:isSimulator() )

-- Are we on iOS?
print( "IOS: ", Scrappy.Device:isIOS() )

-- Are we on Android?
print( "Android: ", Scrappy.Device:isAndroid() )

-- Are we on OSX?
print( "OSX: ", Scrappy.Device:isOSX() )

-- Are we on Windows?
print( "Windows: ", Scrappy.Device:isWindows() )

-- Are we on Linux?
print( "Linux: ", Scrappy.Device:isLinux() )

-- Are we on a Kindle device?
print( "Kindle: ", Scrappy.Device:isKindle() )

-- Are we on an AppleTV device?
print( "AppleTV: ", Scrappy.Device:isAppleTV() )

-- Are we on a FireTV device?
print( "FireTV: ", Scrappy.Device:isAmazonTV() )

-- Are we on an AndroidTV device?
print( "AndroidTV: ", Scrappy.Device:isAndroidTV() )

-- Are we on a desktop?
print( "Desktop: ", Scrappy.Device:isDesktop() )

-- Are we on a mobile device?
print( "Mobile: ", Scrappy.Device:isMobile() )

-- Are we on a TV?
print( "TV: ", Scrappy.Device:isTV() )

-- Are we in a browser?
print( "Web: ", Scrappy.Device:isWeb() )

-- What's our target app store?
print( "Store: ", Scrappy.Device:getTargetStore() )

-- What's our android API level?
print( "API: ", Scrappy.Device:getAPILevel() )

-- Are we on OSX architecture?
print( "OSX Arch: ", Scrappy.Device:architectureIsOSX() )

-- Are we on Windows architecture?
print( "Windows Arch: ", Scrappy.Device:architectureIsWindows() )

-- Are we on a GPU that may cause issues with captures and shaders? Note: This is a running list and not the best.
print( "Naughty GPU: ", Scrappy.Device:willGPUHaveIssuesWithCaptures() )

Trusted vendor

Documentation

$5.00

Log in now to purchase this plugin from Scrappy Ferret.

Once you've activated this plugin, appropriate build.settings code will be generated for you to copy into your Solar2D project. Download links will also be available for inclusion into a Solar2D Native project.

Latest Solar2D contributions by Scrappy Ferret view all