org-tbyrne-cordova-plugins-screenppi
v1.2.0
Published
Adds Screen PPI access to the global screen object in android and iOS.
Downloads
4
Maintainers
Readme
#Cordova Screen PPI Plugin
Cordova plugin to access the screen PPI.
Currently only supports Android & iOS.
Heavily based on Yoik's Screen Orientation API plugin.
The plugin adds the following to the screen object:
screenPPI The average PPI for the screen
##Install
cordova plugin add org.tbyrne.cordova.plugins.screenppi
###Source http://github.com/TomByrne/cordova-screenppi-plugin
##Usage
// Unscaled screen size
screen.screenWidth
screen.screenHeight
// Screen PPI
screen.screenPPIX
screen.screenPPIY
screen.screenPPI // simple average of two above
// Screen pixel scaling (density)
screen.screenDensity
// Scaled versions
screen.screenWidthScaled
screen.screenHeightScaled
screen.screenPPIScaled
Pull requests welcome.