Jump to content

When add sprite to two groups events.onInputDown does not work?


Recommended Posts

Hello, everyone.

I am using Phaser 2.8.3

Basically I want to add a sprite to two groups. In my game I want three columns so I have three column groups.

this.leftColumn = game.add.group();
this.middleColumn = game.add.group();
this.rightColumn = game.add.group();


Later I add buttons into these groups

this.spawnRateButton = [];
for(var i=0;i<3;i++){
    this.spawnRateButton[i].inputEnabled = true;


However here comes my problem. I want these columns to be scrollable, so I have to utilize this https://github.com/trueicecold/phaser-scrollable . 

this.scroller = game.add.existing(new ScrollableArea(x, y, width, height, {horizontalScroll: false})); 

The scrolling works, however, the events.onInputDown of the spawnRateButtons do not. I click the buttons and nothing happens. When I take away the scroller everything works fine except for the scrolling, of course. When I add the sprites individually to the scroller it doesn't work either.


I am guessing this is because I am trying to add the sprites to two groups? Is there a correct way to do this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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