public static DisplayContainer CreateFrom(params DisplayObject[] children) { var container = new DisplayContainer(); foreach (var displayObject in children) { container.AddChild(displayObject); } return(container); }
/// <summary> /// Stops animation on all target's children; /// </summary> public static void StopAllChildren(this DisplayContainer target) { foreach (var displayObject in target) { if (displayObject.totalFrames > 1 || displayObject is MovieClip) { displayObject.Stop(); } } }
/// <summary> /// Searches from bottom for child of type T. Returns null if not found. /// </summary> public static T GetBottomChild <T>(this DisplayContainer container) where T : DisplayObject { foreach (var item in container) { var result = item as T; if (result != null) { return(result); } } return(null); }
/// <summary> /// Searches from top for child of type T. Returns null if not found. /// </summary> public static T GetTopChild <T>(this DisplayContainer container) where T : DisplayObject { DisplayObject result = null; foreach (var item in container) { if (item is T) { result = item; } } return(result as T); }
/// <summary> /// Launches animation on all target's children; /// </summary> public static void PlayAllChildren(this DisplayContainer target, bool random = false) { foreach (var displayObject in target) { if (displayObject.totalFrames > 1 || displayObject is MovieClip) { if (random) { displayObject.GotoRandomFrame(); } displayObject.Play(); } } }
internal void InternalSetParent(DisplayContainer value) { if (_parent != value) { _parent = value; if (_parent != null) { InternalAdded(); } else { InternalRemoved(); } } }
public DisplayTreeIterator(DisplayContainer root) { _root = root; _current = null; }
public TouchRect(DisplayContainer parent) : this() { this.parent = parent; }
public FlashSprite(DisplayContainer parent, SpriteResource resource) { this.resource = resource; this.parent = parent; }
public EmptyObject(DisplayContainer parent) : this() { this.parent = parent; }
public TextField(DisplayContainer parent, int fontSize = 0) : this(fontSize) { this.parent = parent; }
public DisplayContainer(DisplayContainer parent) { this.parent = parent; }
/// <summary> /// Returns bottom child or null if container is empty. /// </summary> public static DisplayObject GetBottomChild(this DisplayContainer container) { return(container.numChildren > 0 ? container.GetChildAt(0) : null); }
public TextLabel(DisplayContainer parent, string fontName, int fontSize = 0) : this(fontName, fontSize) { this.parent = parent; }