Jump to content

ForceOrientation and Group Index


turnA
 Share

Recommended Posts

Hi there,

 

I have additional question about forceOrientation and Group index mechanism:

1. How do we use forceOrientation correctly in the game? I'm using forcePortrait inside the game but I don't see anything different when rotating my device.

2. I'm currently using Group to composite a game component (a puzzle tile with a separate sprite on top of it), but I seem can't order the child index of these Groups.

 

My current Group creation:

 
var tiles = this.game.add.group();
tiles.create(0,0, 'tile_bg');
tiles.create(0,0, 'tile_char');
 

My usual way for index sorting:

 
this.game.world.group.remove(tiles);
this.game.world.group.addAt(tiles, 1);

 

 

But I encounter error, Cannot read property 'onRemovedFromGroup' of undefined.

Any help will be appreciated.

 

Thanks.

Link to comment
Share on other sites

I'm moving to the latest master version (1.1), but now I can't found the global Group properties (previously accessible from this.game.world.group). Where can I access it now?

I also want try to find the container of my custom Group, but it seem I can't get their .group or .parent properties, any information regarding group and their container?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...