Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Problem with particles

Author
Message
Turtle Productions
15
Years of Service
User Offline
Joined: 22nd Jan 2009
Location: Finland
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
, 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

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
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.

Turtle Productions
15
Years of Service
User Offline
Joined: 22nd Jan 2009
Location: Finland
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
Josk
16
Years of Service
User Offline
Joined: 2nd Apr 2008
Location:
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.
Turtle Productions
15
Years of Service
User Offline
Joined: 22nd Jan 2009
Location: Finland
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

Login to post a reply

Server time is: 2024-11-21 16:04:10
Your offset time is: 2024-11-21 16:04:10