View Full Version : spriteparticle_new documentation
Heinz
01-30-2008, 07:27 AM
In the APEDEMO.ppl there is the function spriteparticle_new used, but unfortunately I could neither find it in the help nor could I find the ppl-file where it is defined. Does anybody know what the individual parameters are?
kornalius
01-30-2008, 01:49 PM
Unfortunately the APE functions are not finished in the documentation. There is a thread in the forums that contains the tech document that I sent to PointOfLight to include in the help file.
Heinz
01-30-2008, 02:07 PM
Thanks a lot for the hint, Alain! I found the document you mentioned and the list of additional functions mentioned there are is very impressive!
However the spriteparticle_new I couldn't find there. Do you maybe remember what the parameters are in this function or where I could find them?
PointOfLight
01-30-2008, 05:11 PM
I actually see two functions in the APEDemo file, SpriteParticle_New and SpriteParticle, that I can't find an emails about.
kornalius
01-30-2008, 05:24 PM
spriteparticle_new(spritehandle$, x$, y$, width$, height$, angle$, fixed$, mass$, elasticity$, friction$) -> particlehandle$;
Heinz
02-01-2008, 11:56 AM
Is it possible that width$ and height$ was changed in the parameter order? When I played around with this command, it looked to me as if the height$ parameter came before the width$ parameter.
kornalius
02-01-2008, 03:23 PM
No, Width$ comes before Height$, I just double checked the source code.
Heinz
02-01-2008, 08:11 PM
Sorry, you are right. I supposed that it width$ and height$ was exchanged since when I changed the width$ (not the height$ !) of the sprite, it sank deeper into the floor. However when I checked it with other examples, I also saw that width$ and height$ is not exchanged, but something is a bit strange with the spriteparticle.
When I use spriteparticle with tilted sprites, it seems that the actual physical object is above the shown image and the more the sprite is tilted, the bigger this distance becomes (in contrast to rectangleparticle_new, which doesn't show this problem). In the image below the ball rolled down along the left rectangle. If it rolls down the less tilted right rectangle, it is much nearer to the surface of the rectangle.
It is probably not a PPL problem but simply that I don't use the command properly, but I don't see what could be done differently. Has anybody an idea how I could get rid of this strange behaviour?[br]../../e107_files/public/1201900038_114_FT8883_ape-demo.jpg[br]1201900038_114_FT8883_physic.zip
Nicknack
07-05-2008, 08:49 PM
has anybody found a solution for this problem in the meantime?
the error seems really caused internally by ape , so the only solution I know of is to place the ape_particles manually under the sprites :(
btw can somebody tell me in which folder of the help the ape functions are stored?
mmtbb
07-06-2008, 12:18 AM
Hey Alain,
side note: Your name is followed by "guest". Is that normal?
Sorry, I don't mean to hijack, carry on.
kornalius
07-09-2008, 07:18 PM
Hey Alain,
side note: Your name is followed by "guest". Is that normal?
Sorry, I don't mean to hijack, carry on.
All my migrated posts are like that. I deleted the old kornalius profile, that must be the reason. All new posts are fine.
kornalius
07-09-2008, 07:20 PM
Sorry, you are right. I supposed that it width$ and height$ was exchanged since when I changed the width$ (not the height$ !) of the sprite, it sank deeper into the floor. However when I checked it with other examples, I also saw that width$ and height$ is not exchanged, but something is a bit strange with the spriteparticle.
When I use spriteparticle with tilted sprites, it seems that the actual physical object is above the shown image and the more the sprite is tilted, the bigger this distance becomes (in contrast to rectangleparticle_new, which doesn't show this problem). In the image below the ball rolled down along the left rectangle. If it rolls down the less tilted right rectangle, it is much nearer to the surface of the rectangle.
It is probably not a PPL problem but simply that I don't use the command properly, but I don't see what could be done differently. Has anybody an idea how I could get rid of this strange behaviour?[br]../../e107_files/public/1201900038_114_FT8883_ape-demo.jpg[br]1201900038_114_FT8883_physic.zip
The documentation for APE can be found at http://www.cove.org/ape/docs/api/
I have very limited knowledge of the APE so I cannot help you here.
Nicknack
07-09-2008, 07:55 PM
thx for the tipp alain ;)
maybe the method setdisplay under abstractparticle can solve the problem, but how to call it in ppl?
particle_setDisplay() like particle_addmasslessforce() doesn't operate...
kornalius
07-10-2008, 03:01 PM
Unfortunately the setdisplay function requires a DisplayObject class which we don't support.
You are using the spriteparticle_New() right? Then you are changing the SpriteAngle() ? It could be that the angle value is not calculated the same way with APE. I will take a look more closely and get back to you.
Can you re-attach your code file so I can test?
Nicknack
07-10-2008, 05:21 PM
here is heinz('s) code file hosted on the old forum: http://arianesoft.ca/e107_files/public/1201900038_114_FT8883_physic.zip
no there is no use of spriteangle(), the sprites are already in their surface tilted, but i wonder if it would work with spriteangle()..
i'll give it a try
edit:
ok alain's "idea" works, you can add this code in heinz example without problems:
s$ = loadsprite(AppPath$ + "Boden.bmp", G_RGB(0, 0, 0), 1, 0, NULL);
Setspriteangle(s$,50);
sp$ = spriteparticle_new(s$, 50, 120, 240, 30, TORAD(50), true, 0.2, 0.2, 0);
group_addparticle(cg$, sp$);
so the problem is actual caused by the fact, that the sprites are already tilted in the surface, but ape don't know where the sprite is placed in the surface.
it puts the rectangle particles always in the left top corner.
i think it gots clear if you replace boden.bmp in heinz prog with the attached pic (png!) and make a run ;)
kornalius
07-13-2008, 03:27 PM
Great, I am happy it works. SpriteParticle_new() creates a rectangle around the sprite. I will try implementing a per-pixel check if it's possible in version 2.0.
Nicknack
07-14-2008, 01:00 PM
that would be amazing :D
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.