Package | feathers.utils.display |
Class | public class ScreenDensityScaleCalculator |
Inheritance | ScreenDensityScaleCalculator Object |
Product Version : | Feathers 3.1.0 |
contentScaleFactor
based on the screen
density (sometimes called DPI or PPI).
Method | Defined 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 |
ScreenDensityScaleCalculator | () | Constructor |
public function ScreenDensityScaleCalculator()
Constructor.
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 |
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 |