Bug or change in wade 1.6.1 versus 1.5.1 ?
Shri

Gio,

 

I have the following snippet of code running in a effects manager object

EffectsManager.prototype.energyBall = function(pos) {	var fx = new Sprite(0,wade.app.GAME_LAYER);	var ani;	ani = new Animation('./images/energy64x64x32.png',32,1,60,false);	fx.setSize(64,64);	fx.addAnimation('energyBall',ani);	var energyBall = new SceneObject(fx,0,pos.x,pos.y);	wade.addSceneObject(energyBall);	energyBall.playAnimation('energyBall');	// remove the animation when it has ended	energyBall.onAnimationEnd = function() { wade.removeSceneObject(this); };};	// end energyBall

When I call this function using wade 1.6.1, the effect covers the whole game screen, and doesn't seem to size based on the setSize call.

When I run this using wade 1.5.1, it works as expected - with the effect being 64x64 in size.

So, my question is did something change where I have to make an additional call to set the animation size ?

Or is this a bug ?

 

As always, thanks for any help you can provide.

 

cheers,

Shri

All 2 Comments
Gio

Hi Shri

 

Yes, we changed the default behavior of animations in WADE 1.6. It's this change here:

 

  • Animations are set to autoResize by default

We changed it for consistency reasons - it's a long story, but because of the way you do things now with the visual editor, you do want animations to autoResize by default (it saves time).

 

It would probably work if you didn't set the size of the sprite (it would set it automatically to the size, in pixels, of each animation frame), or if you set it after adding the animation. Alternatively, you could explicitly set the autoResize parameter to false in the Animation constructor.

 

Animation(image, numCellsX, numCellsY, speed, looping, startFrame, endFrame, autoResize, offset)

 

However, I agree that there's something dodgy going on: if you set the size explicitly, it should be taken into account. I will have a closer look and try to fix it for the next release.

Shri

Gio,

 

Thanks for the quick response.

I did this:

"It would probably work...or if you set it after adding the animation"

and it seems to work fine with 1.6.1, haven't tried it with 2.0 yet.

 

cheers,

Shri

Post a reply
Add Attachment
Submit Reply
Login to Reply