Posted: 24th Dec 2011 7:01
When I load a sprite from a texture, then SetSpriteShape. I found there is a mistake. The Collision shape is always the image from (0,0) position of the texture.
Posted: 24th Dec 2011 11:37
That sounds like a good bug

Could you reproduce it with a simple example and post it on the bug board?
Posted: 24th Dec 2011 13:00
Have you tried to update the shape when you animate it, I don't think it shuld update automaticly...
Posted: 24th Dec 2011 13:02
Good point, I assumed he was updating it.
Posted: 24th Dec 2011 13:13
May I ask how to update it ? use AGK::Update() ? it said Sync() can auto call it.
Posted: 24th Dec 2011 13:17
@Zoq2, what's your meaning?
Posted: 24th Dec 2011 13:21
In tier 1 if you call setSpriteShape(sprID, 3) after you change the image the shape will be readjusted. Never tried it on an atlas texture though...
Posted: 24th Dec 2011 13:27
The situation is different, it was not to readjusted. But only use the image at (0,0) position in texture.

@baxslash, Maybe you can write a test project to test what I said.
Posted: 24th Dec 2011 14:49
I will, but it will have to wait till after Christmas now I'm afraid...
Posted: 2nd Jan 2012 14:17
I hope someone can give me a hand.
Posted: 2nd Jan 2012 19:56
Halley, send me an email and I might remember to do some tests on this problem, or have you fixed it?
Posted: 3rd Jan 2012 12:44
Attached is a working example (sorry for the double post but there was no reply and I didn't want halley to miss the answer).

The shape redefines perfectly for me as long as I use "setSpriteShape" after changing the animation frame.
Posted: 4th Jan 2012 8:29
@baxslash, I think the situation is different from what you said. I used TurnDebugOn() to see the outline of the collision shape ,it was totally not right. and I added SetSpriteShape(), it didn't work.
Posted: 4th Jan 2012 9:39
Sorry halley, what command is that? I am using the command "setPhysicsDebugOn()" in my example (attached in my previous post) and it updates the shape just fine. I can't find any other debug commands?
Posted: 4th Jan 2012 10:00
I watched your test project. The situation is really different. There is no atlas texture in your project. The bug is related with atlas texture. Your project didn't meet the bug.

Can you use a atlas texture ? Then you can understand what I said.
Posted: 4th Jan 2012 10:11
There is no atlas texture in your project.

Isn't an atlas texture just a single image with multiple images on? Maybe you are loading the images differently?

I load the image "loadImage(1,"shapes.png")" which has four subimages then use "setSpriteAnimation(1, 128, 128, 4)" to let AppGameKit split the image into four.

I assume you are using "loadSubImage" and either setting the image or adding animation frames, that being the case perhaps it would be easier if you provided an example of the problem?
Posted: 4th Jan 2012 10:13
Atlas textures have their limitations.
Better not use them if you plan to use UV, etc...
Posted: 4th Jan 2012 10:28
?baxslash: I'll try to give a example later.

Maybe bjadams is right. Atlas textures have their limitations.
Posted: 5th Jan 2012 11:27
what is the advantage of atlas files after all?
its better to use single picture files, it's more manageable especially for small game projects
Posted: 5th Jan 2012 11:35
what is the advantage of atlas files after all?

It depends on the images you're using. If you have a lot of different shaped sprites, long and thin images particularly then you're better off using an atlas texture as for each image that's 32x128 (for example) your app will be using 128x128 of memory. If you can use an atlas texture containing 4 sprites at 32x128 each your app is using 1/4 of the amount of memory for those images.