Packagefeathers.utils.display
Classpublic class ScreenDensityScaleCalculator
InheritanceScreenDensityScaleCalculator Inheritance Object

Product Version : Feathers 3.1.0

Selects a value for contentScaleFactor based on the screen density (sometimes called DPI or PPI).



Public Methods
 MethodDefined By
  
Constructor.
ScreenDensityScaleCalculator
  
addScaleForDensity(density:int, scale:Number):void
Adds a new scale for the specified density.
ScreenDensityScaleCalculator
  
getScale(density:int):Number
Returns the ideal contentScaleFactor value for the specified density.
ScreenDensityScaleCalculator
  
removeScaleForDensity(density:int):void
Removes a scale that was added with addScaleForDensity().
ScreenDensityScaleCalculator
Constructor Detail
ScreenDensityScaleCalculator()Constructor
public function ScreenDensityScaleCalculator()

Constructor.

Method Detail
addScaleForDensity()method
public function addScaleForDensity(density:int, scale:Number):void

Adds a new scale for the specified density.

selector.addScaleForDensity( 160, 1 );
selector.addScaleForDensity( 240, 1.5 );
selector.addScaleForDensity( 320, 2 );
selector.addScaleForDensity( 480, 3 );

Parameters

density:int
 
scale:Number

getScale()method 
public function getScale(density:int):Number

Returns the ideal contentScaleFactor value for the specified density.

Parameters

density:int

Returns
Number
removeScaleForDensity()method 
public function removeScaleForDensity(density:int):void

Removes a scale that was added with addScaleForDensity().

selector.addScaleForDensity( 320, 2 );
selector.removeScaleForDensity( 320 );

Parameters

density:int