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 / found bug with agk::setspriteshape

Author
Message
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 23rd Sep 2013 01:55
I don't know if this is a bug or not. If a sprite is loaded and its blank I get an error. I just want to see if someone else gets that error.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Sep 2013 05:32
I think a little more information is needed.

First, what version of AppGameKit? (Obviously Tier 2)

Are you using the agk::LoadSprite command with an image name?

And by 'its blank' do you mean the image file wasn't there or didn't load?

And what error are you getting?

Are you getting this error in something called from within app::Loop or app::Begin?

(Sample code doesn't hurt either.)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 23rd Sep 2013 17:18 Edited at: 23rd Sep 2013 17:26
A completely transparent sprite I think because I check if the sprite exist. I thought it was my code but when I made a program I did this. I am using the latest beta version of agk.


So I even checked if the sprite existed or not.


and it did exist. if I commented the agk::SetSpriteShape out it works.
it says it is the file.\common\box2d\collision\shapes\b2polygonshape.cpp
I got this error: Expression count >3 && count <=12.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd Sep 2013 17:26 Edited at: 23rd Sep 2013 17:27
It's because you are using an automated polygon shape (parameter 3 in setSpriteShape) on a blank image. It cannot create a shape with zero sides which is what it is trying to do. You have to specify a shape if the image is blank although I'm not sure why you would want a completely transparent image in the first place? Why not use "setSpriteVisible(spriteID, 0)" and use an image to define the shape?

Parragil para o mundo!
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 23rd Sep 2013 19:52 Edited at: 23rd Sep 2013 20:03
I think I found a temp solution have sprites on the black spots that have a transparency of 1. So the user can not see them. And make it just a few pixels, on empty spots on sprite sheet. I guess that worked also so know I don't have to worry about that error.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th Sep 2013 14:28 Edited at: 24th Sep 2013 14:29
The problem with that is you are displaying possibly lots of transparent sprites which will reduce your draw speed and slow down your app. The correct and sensible way to deal with this is to create a shape using one of the "none automatic" methods and make the sprite not visible. That way you will not be creating draw calls to fully transparent sprites. Transparent sprites can have a massive performance impact.

Parragil para o mundo!

Login to post a reply

Server time is: 2024-05-09 11:00:18
Your offset time is: 2024-05-09 11:00:18