AlignUtil
| Kind of class: | public class |
|---|---|
| Package: | org.casalib.util |
| Inherits from: | none |
| Version: | 09/20/08 |
| Author: | Aaron Clinger |
| Classpath: | org.casalib.util.AlignUtil |
| File last modified: | Monday, 01 December 2008, 11:16:36 |
Provides utility functions aligning DisplayObjects.
Summary
Class methods
- alignLeft (displayObject:DisplayObject, bounds:Rectangle) : void
- Aligns a DisplayObject to the left side of the bounding Rectangle.
- alignRight (displayObject:DisplayObject, bounds:Rectangle) : void
- Aligns a DisplayObject to the right side of the bounding Rectangle.
- alignTop (displayObject:DisplayObject, bounds:Rectangle) : void
- Aligns a DisplayObject to the top of the bounding Rectangle.
- alignBottom (displayObject:DisplayObject, bounds:Rectangle) : 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) : 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.
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) : 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.
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) : 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.
alignTop
public static function alignTop (
displayObject:DisplayObject,
bounds:Rectangle) : 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.