Jump to content

anchor point when play a different size animation


SSStand
 Share

Recommended Posts

I have a sprite sheet , which one has a sequenced animation 
with different size , and i have set the anchor point to .5,.5
when i create the sprite , however since there are frames with different

size , the default anchor point do not belongs to the center position.

how do you treat about this  issue ? any advice are welcome.

 

Thanks in advance.

 

some code for instance:

 this.wb = g.add.sprite(w, h, "wb"); this.wb.anchor.setTo(.5, .7); // TODO this.wb.body.collideWorldBounds = true; this.wb.body.bounce.setTo(0, 0); this.wb.animations.add( 'stay' , framesNamesGene(symWindBladeSpr, 0, 10, "", 4), 16 , true); this.wb.animations.add( 'move', framesNamesGene(symWindBladeSpr, 11, 14, "", 4), 25, true ); this.wb.animations.add('wind_slash', framesNamesGene(symWindBladeSpr, 15, 35, "", 4), 10 , true); this.wb.animations.add('wind_blade', framesNamesGene(symWindBladeSpr, 36, 44, "", 4), 24 , true ); g.camera.follow(this.wb); this.wb.animations.play("wind_slash");
Link to comment
Share on other sites

  • 2 years later...
 Share

  • Recently Browsing   0 members

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