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.

Newcomers AppGameKit Corner / Spriter animations and collision/touch detection

Author
Message
psychoanima
5
Years of Service
User Offline
Joined: 19th Jun 2018
Location:
Posted: 27th Jan 2023 00:33
I just realized that imported Spriter models don't have bounding boxes/collision shapes and that GetSpriteHit is returning 0 when Spriter model is touched (with GetPointerPressed). Since Appgamekit is not giving me access to Spriter atlas/textures, I need help how to make these files identified by touch/collision.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 27th Jan 2023 19:36 Edited at: 27th Jan 2023 20:03
limited experience with skeletons but based on this comment, i think your best bet is to create a sprite and attach it to the skeleton, somehow.

when i attached a 100x250 sprite to the skeleton in the Spriter example via FixSpriteToSkeleton2D(), i experienced some visual anomolies with the "collision" sprite (including a visible CreateDummySprite() sprite that was NOT the 100x250 i set it to):

..but the sprite registered proper hits, regardless. unknown what caused the visuals... there's some scaling and offsetting going on somewhere.

manual placement of the collision sprite based on GetSkeleton2DX/Y worked normally, of course (and i didnt try box2d methods which would allow additional sprite shapes, etc).

anyway, that's where i would start.

Attachments

Login to view attachments
psychoanima
5
Years of Service
User Offline
Joined: 19th Jun 2018
Location:
Posted: 27th Jan 2023 21:43
Thank you very much for the tip!


I also found strange anomalies while working with Spriter models on percentage-based screen layout where Spriter texture is abnormally stretched on 1.33 aspect ratio screen.

Login to post a reply

Server time is: 2024-04-19 16:24:37
Your offset time is: 2024-04-19 16:24:37