diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index 722c34a..90e0e86 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -431,6 +431,25 @@ }; /** + * Set the parent Container of this DisplayObject + * + * @param container {Container} The Container to add this DisplayObject to + * @return {DisplayObject} This DisplayObject + */ +DisplayObject.prototype.setParent = function (container) +{ + if (!container || !container.addChild) + { + throw new Error('setParent: Argument must be a Container'); + } + else + { + container.addChild(this); + return this; + } +}; + +/** * Base destroy method for generic display objects * */