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 Studio Chat / setspriteoffset() and setspriteflip()

Author
Message
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 21st Apr 2020 12:54 Edited at: 12th May 2020 16:43
Hello,
I noticed a bug, well I think because I couldn't figure out how to fix the problem.
with SetSpriteShape (sprite, 3), the turn of the devil's wing on image 1 is not on the wing
with SetSpriteShape (sprite, 1), the center of the circle is on the offset
with SetSpriteShape (sprite, 2) , the square is well on the wing

SetSpriteShape(sprite,3)

SetSpriteShape(sprite,1)

SetSpriteShape(sprite,2)


Thx !
I do what i do !!!

Attachments

Login to view attachments
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 21st Apr 2020 13:12
Without seeing the code (and possibly media) it is impossible to guess what you are doing and what results you expect to see.
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 21st Apr 2020 13:43
it's simple :
I shifted the offset of the demon's wings to the side so that they pivot behind the demon!
There is nothing special in the code or in the media.
I think it has a bug when the setting of the polygonal form, this one is shifted if we reverse the image
I do what i do !!!
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 10th May 2020 08:06
Upi Upa ^^
I do what i do !!!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 10th May 2020 08:28
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 11th May 2020 15:53 Edited at: 11th May 2020 15:54
Quote: "Is it this?"

if it is, it was fixed in the 2019.02.19 update but it does read: "Fixed SetSpriteFlip incorrectly adjusting the center of circle physics shapes" suggesting circles vs all shapes? i know the circles were working fine after the fix.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 11th May 2020 16:51 Edited at: 11th May 2020 16:59
The bug fixed in the 2019.02.19 update is unrelated really.

In fact, I dont believe there is a bug at all.

Quote: "with SetSpriteShape (sprite, 2), the center of the circle is on the offset"

Shape type 2 ISNT a circle...its a box. it looks like you have mixed up the image numbers and shape numbers. i will assume you meant shape type 1 = circle
The AppGameKit documentation for SetSpriteShape() states:
Circle shape will create a perfect circle centered on the sprite's rotation point and big enough to enclose the sprite's visible pixels.

So its working exactly as expected as shown by the image above (2nd one down)

Quote: "with SetSpriteShape (sprite, 3) , the square is well on the wing"

Shape type 3 ISNT a box...its a polygone. Again, it looks like you have mixed up shape numbers. i will assume you meant shape type 2= box
The AppGameKit documentation for SetSpriteShape() states:
Box will create a box around the edges of the sprite, without regard to whether pixels are visible or not.

So this is also working as it should and is shown in the 3rd image down.

Quote: " with SetSpriteShape (sprite, 1), the turn of the devil's wing on image 1 is not on the wing "

Shape type 1 ISNT a polygon...its a box. Again, it looks like you have mixed up shape numbers. i will assume you meant shape type 3= polygon
This will work fine as long as you set the sprite shape after you set the sprite offset. You cant set the sprite offset after setting the sprite shape as it shifts the sprite shape.

Either reorder the setting off the sprite shape after setting the offset...or set the sprite shape AGAIN after setting the offset and it will be correct over the wing and correctly flipped too.
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 12th May 2020 16:52
thank you,
I corrected my 1st post indeed, I had mixed the figures
That done, I tried to place: setspriteflip, setspriteoffset and setspriteshape in all directions and never with setspriteshape 3, the shape is on the drawing when the one is flipped
I do what i do !!!
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 12th May 2020 17:42 Edited at: 12th May 2020 17:43
Here is a simple example with wings


As you can see the wings have the correct flipped shape and it is inline with the graphics.

I have attached this very simple project and so you can try it yourself.

Scraggle wrote: "Without seeing the code (and possibly media) it is impossible to guess what you are doing and what results you expect to see."


Scraggle is very right. You havent posted any code at all .....so it is very difficult to say what you are doing wrong.

Attachments

Login to view attachments
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 12th May 2020 21:57 Edited at: 12th May 2020 22:10
ok, your code works well thank you so much !

I modified it to make it work with my wings, it works too.
Your code and mine are the same, well, I believe !


I put the image with the post!
it remains quite incomprehensible

I modified the positions of the last three lines without any result and I launched the game with agk 2 and agk studio
I do what i do !!!
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 12th May 2020 22:13 Edited at: 12th May 2020 22:14
Set the shape first then flip the sprite as I did in my code. It works as I have shown. You seem to be repeatedly trying to do it in the wrong order.
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 13th May 2020 06:33
Quote: "
I modified the positions of the last three lines without any result and I launched the game with agk 2 and agk studio"


I uninstalled and reinstalled agk2 but it doesn't come from that either ...

I do what i do !!!

Login to post a reply

Server time is: 2024-04-20 04:09:49
Your offset time is: 2024-04-20 04:09:49