Packagefeathers.display
Classpublic class Scale3Image
InheritanceScale3Image Inheritance starling.display.Sprite
Implements IValidating

Scales an image like a "pill" shape with three regions, either horizontally or vertically. The edge regions scale while maintaining aspect ratio, and the middle region stretches to fill the remaining space.



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

The textures displayed by this image.

In the following example, the textures are changed:

         image.textures = new Scale3Textures( texture, firstRegionWidth, secondRegionWidth, Scale3Textures.DIRECTION_HORIZONTAL );


Implementation
    public function get textures():Scale3Textures
    public function set textures(value:Scale3Textures):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, 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
Scale3Image()Constructor
public function Scale3Image(textures:Scale3Textures, textureScale:Number = 1)

Constructor.

Parameters
textures:Scale3Textures
 
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.