feathersui / feathersui-starling

User interface components for Starling Framework and Adobe AIR
https://feathersui.com/learn/as3-starling/
Other
915 stars 386 forks source link

AnchorLayoutData: convenience methods for anchor display objects #1735

Open kevinfoley opened 6 years ago

kevinfoley commented 6 years ago

Right now, when using an anchor layout, we can anchor one object to another like this:

var ald:AnchorLayoutData = new AnchorLayoutData();
ald.bottom = 5;
ald.bottomAnchorDisplayObject = someGraphic;

This is a bit clumsy, particularly because the property names (e.g. bottomAnchorDisplayObject) are so long.

It would be great to have a convenience method that combined the distance and display object properties into a single function with a shorter name, something like:

public function anchorBottomTo(target:DisplayObject, distance:Number):void

Which we would call like this:

ald.anchorBottomTo(someGraphic, 5);