Add test for PhysicsSprite bug#11618

This commit is contained in:
pandamicro 2015-08-03 11:07:27 +08:00
parent b034268331
commit 9393daaf8f
1 changed files with 18 additions and 0 deletions

View File

@ -132,6 +132,15 @@ var ChipmunkSprite = ChipmunkBaseLayer.extend( {
this.addSprite = function( pos ) { this.addSprite = function( pos ) {
var sprite = this.createPhysicsSprite( pos ); var sprite = this.createPhysicsSprite( pos );
var child = new cc.Sprite(s_pathSister1);
child.attr({
scale: 0.4,
anchorX: 0,
anchorY: 0,
x: sprite.width/2,
y: sprite.height/2
});
sprite.addChild(child);
this.addChild( sprite ); this.addChild( sprite );
}; };
@ -231,6 +240,15 @@ var ChipmunkSpriteBatchTest = ChipmunkSprite.extend( {
this.addSprite = function( pos ) { this.addSprite = function( pos ) {
var sprite = this.createPhysicsSprite( pos ); var sprite = this.createPhysicsSprite( pos );
var child = new cc.Sprite(s_pathGrossini);
child.attr({
scale: 0.4,
anchorX: 0,
anchorY: 0,
x: sprite.width/2,
y: sprite.height/2
});
sprite.addChild(child);
this.batch.addChild( sprite ); this.batch.addChild( sprite );
}; };