Posted: 4th Sep 2011 18:48
Hi! I got a problem when positioning moving particles (emitters) to moving sprites (I think the moving isn't affecting to problem).
I have a player sprite (101), and when I try to position my particle emitter to it like this
+ Code Snippet
SetParticlesPosition (1,GetSpriteX(101),GetSpriteY(101))
, the particle emitter is far away from player sprite.
See the picture attached.

I tried playing with world and screen coords but without results.

Thanks,
TP
Posted: 4th Sep 2011 18:53
Have you adjusted the sprite offset? The x and y of the sprite is defaulted to the upper left corner, NOT the center of the sprite.

So maybe use GetSpriteXByOffset()? etc.
Posted: 4th Sep 2011 21:21
I have adjusted the sprite offset, but the sprite itself is small, and the emitter of particles is faaar away, even if I use GetSpriteXByOffset instead of GetSpriteX.
Maybe I need to play with world-screen coords.
Anyway, thanks Rich!

Thanks,
TP
Posted: 4th Sep 2011 21:42
I had a similiar problem with sprites, GetSpriteXByOffset didn't sort it but SetSpritePositionByOffset did.

Theres no setparticleByoffset though only Set ParticlesPosition.
Posted: 4th Sep 2011 22:05
Yeah, I had to play a little w/ ByOffsets and got it working xD
BTW I had SetParticlesStartZone failed. Now it works, so thanks Josk and Rich!

Thanks,
TP