Jump to content

Bound sprite not working


cidhunter
 Share

Recommended Posts

Hi guys, 

Just trying out phaser. So far so good but I couldn't for the life of me figure out what went wrong when I'm trying to create a slider bar (vertical slider bar). 

I'm following this example: http://phaser.io/examples/v2/input/bounds-sprite

But for some reason, my sprite is not bound. 

The code:

sliderBarLeft = game.add.sprite(0,0, 'buttons', 'sliderBase.png'); 

sliderLeft = game.add.sprite(0,0,'buttons','sliderBtn.png); 

sliderLeft.alignIn(sliderBarLeft, Phaser.TOP_CENTER,0,0); 

sliderLeft.inputEnabled = true; 

sliderLeft.anchor.set(0.5); 

sliderLeft.input.enableDrag(); 

sliderLeft.input.BoundsSprite = sliderBarLeft;

Any help would be much appreciated. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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