AlignUtil

Kind of class:public class
Package:org.casalib.util
Inherits from:none
Version:05/29/09
Author:Aaron Clinger, Jon Adams
Classpath:org.casalib.util.AlignUtil
File last modified:Friday, 29 May 2009, 08:09:01
Provides utility functions aligning DisplayObjects.

Summary


Class methods
  • alignLeft (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void
    • Aligns a DisplayObject to the left side of the bounding Rectangle.
  • alignRight (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void
    • Aligns a DisplayObject to the right side of the bounding Rectangle.
  • alignTop (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void
    • Aligns a DisplayObject to the top of the bounding Rectangle.
  • alignBottom (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void
    • Aligns a DisplayObject to the bottom of the bounding Rectangle.
  • alignCenter (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true) : void
    • Aligns a DisplayObject to the horizontal center of the bounding Rectangle.
  • alignMiddle (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true) : void
    • Aligns a DisplayObject to the vertical middle of the bounding Rectangle.
  • alignCenterMiddle (displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true) : void
    • Aligns a DisplayObject to the horizontal center and vertical middle of the bounding Rectangle.

Class methods

alignBottom

public static function alignBottom (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void

Aligns a DisplayObject to the bottom of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.
outside :
Align the DisplayObject to the outside of the bounds true, or the inside false.

alignCenter

public static function alignCenter (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true) : void

Aligns a DisplayObject to the horizontal center of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.

alignCenterMiddle

public static function alignCenterMiddle (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true) : void

Aligns a DisplayObject to the horizontal center and vertical middle of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.

alignLeft

public static function alignLeft (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void

Aligns a DisplayObject to the left side of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.
outside :
Align the DisplayObject to the outside of the bounds true, or the inside false.

alignMiddle

public static function alignMiddle (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true) : void

Aligns a DisplayObject to the vertical middle of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.

alignRight

public static function alignRight (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void

Aligns a DisplayObject to the right side of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.
outside :
Align the DisplayObject to the outside of the bounds true, or the inside false.

alignTop

public static function alignTop (
displayObject:DisplayObject, bounds:Rectangle, snapToPixel:Boolean = true, outside:Boolean = false) : void

Aligns a DisplayObject to the top of the bounding Rectangle.
Parameters:
displayObject:
The DisplayObject to align.
bounds :
The area in which to align the DisplayObject.
snapToPixel :
Force the position to whole pixels true, or to let the DisplayObject be positioned on sub-pixels false.
outside :
Align the DisplayObject to the outside of the bounds true, or the inside false.