Skip to content

Commit 54dda37

Browse files
committed
Merge pull request #1154 from dingpinglv/Iss1152_FixParticleSystemsBug
Fixed #1152: fixed a cc.ParticleSystem's bug that it doesn't work in position type cc.PARTICLE_TYPE_RELATIVE
2 parents 905cd9f + 60ca86e commit 54dda37

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cocos2d/particle_nodes/CCParticleSystem.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1830,8 +1830,10 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
18301830
// position
18311831
if (this._positionType == cc.PARTICLE_TYPE_FREE)
18321832
particle.startPos = this.convertToWorldSpace(this._pointZeroForParticle);
1833-
else if (this._positionType == cc.PARTICLE_TYPE_RELATIVE)
1834-
particle.startPos = this._position;
1833+
else if (this._positionType == cc.PARTICLE_TYPE_RELATIVE){
1834+
particle.startPos.x = this._position.x;
1835+
particle.startPos.y = this._position.y;
1836+
}
18351837

18361838
// direction
18371839
var a = cc.DEGREES_TO_RADIANS(this._angle + this._angleVar * locRandomMinus11());
@@ -2056,7 +2058,6 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
20562058
var currentPosition = cc.Particle.TemporaryPoints[0];
20572059
if (this._positionType == cc.PARTICLE_TYPE_FREE) {
20582060
cc.pIn(currentPosition, this.convertToWorldSpace(this._pointZeroForParticle));
2059-
20602061
} else if (this._positionType == cc.PARTICLE_TYPE_RELATIVE) {
20612062
currentPosition.x = this._position.x;
20622063
currentPosition.y = this._position.y;

0 commit comments

Comments
 (0)