Packagefeathers.display
Classpublic class Scale9Image
InheritanceScale9Image Inheritance starling.display.Sprite
Implements IValidating

Scales an image with nine regions to maintain the aspect ratio of the corners regions. The top and bottom regions stretch horizontally, and the left and right regions scale vertically. The center region stretches in both directions to fill the remaining space.



Public Properties
 PropertyDefined By
  color : uint
The color value to pass to the images.
Scale9Image
  depth : int
[read-only] The component's depth in the display list, relative to the stage.
Scale9Image
  smoothing : String
The smoothing value to pass to the images.
Scale9Image
  textures : Scale9Textures
The textures displayed by this image.
Scale9Image
  textureScale : Number
Scales the texture dimensions during measurement.
Scale9Image
  useSeparateBatch : Boolean
Determines if the regions are batched normally by Starling or if they're batched separately.
Scale9Image
Public Methods
 MethodDefined By
  
Scale9Image(textures:Scale9Textures, textureScale:Number = 1)
Constructor.
Scale9Image
  
Readjusts the dimensions of the image according to its current textures.
Scale9Image
  
validate():void
Immediately validates the display object, if it is invalid.
Scale9Image
Property Detail
colorproperty
color:uint

The color value to pass to the images.

In the following example, the color is changed:

         image.color = 0xff00ff;

The default value is 0xffffff.


Implementation
    public function get color():uint
    public function set color(value:uint):void
depthproperty 
depth:int  [read-only]

The component's depth in the display list, relative to the stage. If the component isn't on the stage, its depth will be -1.

Used by the validation system to validate components from the top down

.


Implementation
    public function get depth():int
smoothingproperty 
smoothing:String

The smoothing value to pass to the images.

In the following example, the smoothing is changed:

         image.smoothing = TextureSmoothing.NONE;

The default value is starling.textures.TextureSmoothing.BILINEAR.


Implementation
    public function get smoothing():String
    public function set smoothing(value:String):void

See also

texturesproperty 
textures:Scale9Textures

The textures displayed by this image.

In the following example, the textures are changed:

         image.textures = new Scale9Textures( texture, scale9Grid );


Implementation
    public function get textures():Scale9Textures
    public function set textures(value:Scale9Textures):void
textureScaleproperty 
textureScale:Number

Scales the texture dimensions during measurement. Useful for UI that should scale based on screen density or resolution.

In the following example, the texture scale is changed:

         image.textureScale = 2;

The default value is 1.


Implementation
    public function get textureScale():Number
    public function set textureScale(value:Number):void
useSeparateBatchproperty 
useSeparateBatch:Boolean

Determines if the regions are batched normally by Starling or if they're batched separately.

In the following example, the separate batching is disabled:

         image.useSeparateBatch = false;

The default value is true.


Implementation
    public function get useSeparateBatch():Boolean
    public function set useSeparateBatch(value:Boolean):void
Constructor Detail
Scale9Image()Constructor
public function Scale9Image(textures:Scale9Textures, textureScale:Number = 1)

Constructor.

Parameters
textures:Scale9Textures
 
textureScale:Number (default = 1)
Method Detail
readjustSize()method
public function readjustSize():void

Readjusts the dimensions of the image according to its current textures. Call this method to synchronize image and texture size after assigning textures with a different size.

validate()method 
public function validate():void

Immediately validates the display object, if it is invalid. The validation system exists to postpone updating a display object after properties are changed until until the last possible moment the display object is rendered. This allows multiple properties to be changed at a time without requiring a full update every time.