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 / Check if getspritehit has hit transparentcy

Author
Message
Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 21st Aug 2011 16:40
Hi,

I'm looking for a way to see if getspritehit has hit transparency part of a picture. I looked into getspritehittest but my sprite is a bit more complex than just a sqaure or a circle.

Any thoughts?

Only heroes live forever
Scotty1973
AGK Backer
12
Years of Service
User Offline
Joined: 2nd Jun 2011
Location: Burton-on-Trent, uk
Posted: 21st Aug 2011 17:33
Hi,

Dont know if this will be any use, but you can use polygon shape instead of circle or square.

http://www.appgamekit.com/documentation/Reference/Sprite/SetSpriteShape.htm

though using polygon will affect performance if lots of sprites are used.

Scott
Redostrike
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Belgium
Posted: 21st Aug 2011 19:20
4 sprites that need to be checked and one more for background, but polygon is still not the best way my sprite is still more complex for that. I think it's not there (no possible way) at this point.

Maybe in future release of AGK.

Only heroes live forever
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 22nd Aug 2011 19:00
You can create compound shapes for sprites by using AddSpriteShapePolygon(), but unfortunately you'll have to work out the vertices manually.

Login to post a reply

Server time is: 2024-04-25 16:27:35
Your offset time is: 2024-04-25 16:27:35