Skip to content

Commit cfc4528

Browse files
committed
Containers no longer in beta.
1 parent 59ec8de commit cfc4528

3 files changed

Lines changed: 5 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### New Features
66

7+
* Containers are now fully available! We have removed the beta warning and fixed the way in which they work with Cameras, input and scroll factors. They are also fully documented, so please see their docs and examples for use.
78
* Group.getLast will return the last member in the Group matching the search criteria.
89
* Group.getFirstNth will return the nth member in the Group, scanning from top to bottom, that matches the search criteria.
910
* Group.getLastNth will return the nth member in the Group, scanning in reverse, that matches the search criteria.

src/gameobjects/container/Container.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ var Vector2 = require('../../math/Vector2');
1818
* @classdesc
1919
* A Container Game Object.
2020
*
21-
* WARNING: EXPERIMENTAL. There are several known cases where Containers will not behave correctly,
22-
* especially if you use a multi-camera or transformed camera set-up. We are still working on them,
23-
* but wanted to release as part of 3.4 under a beta feature flag, because in the main they work
24-
* are and worth getting used to.
25-
*
2621
* A Container, as the name implies, can 'contain' other types of Game Object.
2722
* When a Game Object is added to a Container, the Container becomes responsible for the rendering of it.
2823
* By default it will be removed from the Display List and instead added to the Containers own internal list.
@@ -44,8 +39,10 @@ var Vector2 = require('../../math/Vector2');
4439
* to use as their hit area. Container children can also be enabled for input, independent of the Container.
4540
*
4641
* Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However,
47-
* if Container children are enabled for physics you may get unexpected results,such as offset bodies,
48-
* if the Container itself, or any of its ancestors, is positioned anywhere other than at 0x0.
42+
* if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies,
43+
* if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children
44+
* with physics do not factor in the Container due to the excessive extra calculations needed. Please structure
45+
* your game to work around this.
4946
*
5047
* It's important to understand the impact of using Containers. They add additional processing overhead into
5148
* every one of their children. The deeper you nest them, the more the cost escalates. This is especially true

src/gameobjects/container/ContainerFactory.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
var Container = require('./Container');
99
var GameObjectFactory = require('../GameObjectFactory');
1010

11-
var hasWarned = false;
12-
1311
/**
1412
* Creates a new Container Game Object and adds it to the Scene.
1513
*
@@ -26,11 +24,5 @@ var hasWarned = false;
2624
*/
2725
GameObjectFactory.register('container', function (x, y, children)
2826
{
29-
if (!hasWarned)
30-
{
31-
console.warn('Use of a beta feature: Containers');
32-
hasWarned = true;
33-
}
34-
3527
return this.displayList.add(new Container(this.scene, x, y, children));
3628
});

0 commit comments

Comments
 (0)