From 7f504d402e9c5496b3c2f6ef9fb69a4bc4a814f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=9D=E9=BE=99?= Date: Thu, 15 Nov 2018 19:19:49 +0800 Subject: [PATCH 1/2] setDisplayFrame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit setDisplayFrame的时候没有传入rect,导致绘制的是整张图片。 --- cocos2d/particle/CCParticleSystem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/particle/CCParticleSystem.js b/cocos2d/particle/CCParticleSystem.js index 7a18fa4f32..17511ecebb 100644 --- a/cocos2d/particle/CCParticleSystem.js +++ b/cocos2d/particle/CCParticleSystem.js @@ -2036,7 +2036,7 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{ // update texture before updating texture rect var texture = spriteFrame.getTexture(), locTexture = this._texture; if (locTexture !== texture) - this.setTexture(texture); + this.setTextureWithRect(texture, spriteFrame.getRect()); }, /** From f5831539ededf84d89bd999e702d7c1548fdf609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=9D=E9=BE=99?= Date: Fri, 16 Nov 2018 11:49:15 +0800 Subject: [PATCH 2/2] CCParticleSystem.setDisplayFrame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正使用同一个frame的不同图片无效的问题 --- cocos2d/particle/CCParticleSystem.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cocos2d/particle/CCParticleSystem.js b/cocos2d/particle/CCParticleSystem.js index 17511ecebb..ff96ca8d5e 100644 --- a/cocos2d/particle/CCParticleSystem.js +++ b/cocos2d/particle/CCParticleSystem.js @@ -2035,8 +2035,7 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{ // update texture before updating texture rect var texture = spriteFrame.getTexture(), locTexture = this._texture; - if (locTexture !== texture) - this.setTextureWithRect(texture, spriteFrame.getRect()); + this.setTextureWithRect(texture, spriteFrame.getRect()); }, /**