Jump to content

How do you do a sliding menu?


kelvinblade
 Share

Recommended Posts

I am trying to make a sliding menu but I am not sure how to tween the group to slide.

 

this.menuGroup = game.add.group();

this.menu = game.add.sprite(game.world.centerX, game.world.height, 'menu');
this.menuGroup.add(this.menu);
this.menuCloseButton = game.add.sprite(game.world.width, game.world.centerY, 'menuCloseButton');
this.menuGroup.add(this.menuCloseButton);
this.menuCloseButton.events.onInputDown.add(this.removeMenu, this);
 
game.add.tween(this.menuGroup._container).to({y: game.world.centerY}, 300).start();
 
 
It gave me an error saying y doesn't exist for menuGroup.
 
1) Is this the correct way to do a sliding menu?
 
2) Also is it possible to group the text labels into the menu group as well?
 
Thanks in advance. Any help is appreciated.
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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