File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -38,15 +38,31 @@ this.createjs = this.createjs||{};
3838 * containers have their <code>transform</code> and <code>alpha</code> properties concatenated with their parent
3939 * Container.
4040 *
41- * For example, a {{#crossLink "Shape"}}{{/crossLink}} with x=100 and alpha=0.5, placed in a Container with <code> x=50</code>
42- * and <code> alpha=0.7</code> will be rendered to the canvas at <code> x=150</code> and <code> alpha=0.35</code>.
43- * Containers have some overhead, so you generally shouldn't create a Container to hold a single child.
41+ * For example, a {{#crossLink "Shape"}}{{/crossLink}} with x=100 and alpha=0.5, placed in a Container with ` x=50`
42+ * and ` alpha=0.7` will be rendered to the canvas at ` x=150` and ` alpha=0.35`. Containers have some overhead, so you
43+ * generally shouldn't create a Container to hold a single child.
4444 *
4545 * <h4>Example</h4>
46+ *
4647 * var container = new createjs.Container();
4748 * container.addChild(bitmapInstance, shapeInstance);
4849 * container.x = 100;
4950 *
51+ * Containers also provide a fairly easy solution for managing depth sorting. Multiple containers can be set up to
52+ * represent different depths in a game or application, and children of each container will be visually sorted in each
53+ * depth.
54+ *
55+ * <h4>Example</h4>
56+ *
57+ * // Add all background elements to this container
58+ * var background = new createjs.Container();
59+ *
60+ * // Add all game sprites to this container
61+ * var sprites = new createjs.Container();
62+ *
63+ * // Add all foreground UI to this container
64+ * var ui = new createjs.Container();
65+ *
5066 * @class Container
5167 * @extends DisplayObject
5268 * @constructor
You can’t perform that action at this time.
0 commit comments