GODPAPER | All Packages | All Classes | Index | Frames No Frames |
DeviceCapabilities

Package | feathers.system
Class | public class DeviceCapabilities
Inheritance | DeviceCapabilities Object

Using values from the Stage and Capabilities classes, makes educated guesses about the physical size of the device this code is running on.

Public Properties

| Property | Defined By
--- | --- | ---
|  | dpi : int [static] The DPI to be used by Feathers. | DeviceCapabilities
|  | screenPixelHeight : Number = NaN [static] A custom height, in pixels, to use for calculations of the device's physical screen size. | DeviceCapabilities
|  | screenPixelWidth : Number = NaN [static] A custom width, in pixels, to use for calculations of the device's physical screen size. | DeviceCapabilities
|  | tabletScreenMinimumInches : Number = 5 [static] The minimum physical size, in inches, of the device's larger side to be considered a tablet. | DeviceCapabilities

Public Methods

| Method | Defined By
--- | --- | ---
|  | isPhone(stage:Stage):Boolean [static] Determines if this device is probably a phone, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI. | DeviceCapabilities
|  | isTablet(stage:Stage):Boolean [static] Determines if this device is probably a tablet, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI. | DeviceCapabilities
|  | screenInchesX(stage:Stage):Number [static] The physical width of the device, in inches. | DeviceCapabilities
|  | screenInchesY(stage:Stage):Number [static] The physical height of the device, in inches. | DeviceCapabilities

Property Detail

dpi | property

`public static var dpi:int`

The DPI to be used by Feathers. Defaults to the value of `Capabilities.screenDPI`, but may be overridden. For example, if one wishes to demo a mobile app in the desktop browser, a custom DPI will override the real DPI of the desktop screen.

screenPixelHeight | property |

`public static var screenPixelHeight:Number = NaN`

A custom height, in pixels, to use for calculations of the device's physical screen size. Set to NaN to use the actual height.

screenPixelWidth | property |

`public static var screenPixelWidth:Number = NaN`

A custom width, in pixels, to use for calculations of the device's physical screen size. Set to NaN to use the actual width.

tabletScreenMinimumInches | property |

`public static var tabletScreenMinimumInches:Number = 5`

The minimum physical size, in inches, of the device's larger side to be considered a tablet.

Method Detail

isPhone | () | method

`public static function isPhone(stage:Stage):Boolean`

Determines if this device is probably a phone, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI.

Parameters

| `stage:Stage`

Returns

| `Boolean`

isTablet | () | method |

`public static function isTablet(stage:Stage):Boolean`

Determines if this device is probably a tablet, based on the physical width and height, in inches, calculated using the full-screen dimensions and the screen DPI.

Parameters

| `stage:Stage`

Returns

| `Boolean`

screenInchesX | () | method |

`public static function screenInchesX(stage:Stage):Number`

The physical width of the device, in inches. Calculated using the full-screen width and the screen DPI.

Parameters

| `stage:Stage`

Returns

| `Number`

screenInchesY | () | method |

`public static function screenInchesY(stage:Stage):Number`

The physical height of the device, in inches. Calculated using the full-screen height and the screen DPI.

Parameters

| `stage:Stage`

Returns

| `Number`

Thu Jan 16 2014, 01:11 PM +08:00