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 / [NOT A BUG!] SetSpriteFlip

Author
Message
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2017 16:27
Hey, originally I was gonna rely on the sprite flipping feature to reduce the # of sprite images by half in my latest game project.

However, there seems to be some kind of bug in there. Even with the handle (offset for position) set to be horizontally centered using SetSpriteFlip to horizontally flip the sprite results in the sprite position appearing to move.

I keep my full image sheets texture at a power of 2 out of habit. And I tested making each sub image a power of 2 as well but get the same behavior.

What I expected is that flipping the sprite would simply flip the sub image to face the opposite direction and it would remain at the same position on screen.

What I got was the image was flipped to face the other way and the position of the sprite jumped.

My workaround for now is to manually flip all of the sprites and include them in my sprite sheet.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 2nd Feb 2017 16:55
Are you sure your graphics are exactly centred in the sub-image? - Just want to make sure you aren't having the same problem as the chap in this post
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Feb 2017 17:10
i can't reproduce, can you provide a example?

AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2017 17:19 Edited at: 2nd Feb 2017 17:23
I'll try again tonight. I'd love to be able to just flip due to cutting workload down.

Maybe I was doing something crazy. Always possible. Mainly I just wanted to throw this out there and see if anyone else can confirm it.

Since that isn't the case it seems I messed up somewhere. My images (at least current set) are centered as far as the body of the characters (which are just rectangles) are concerned. But just maybe that wasn't the case early on when I was testing.

Will test tonight and report back.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 2nd Feb 2017 17:24
Quote: "i can't reproduce"
Viagra might help! Hahaha.... Sorry. That was a really bad joke. I tried viagra once but it got stuck in my throat... I had a stiff neck for days!

Oh dear... Sorry...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 2nd Feb 2017 17:44
@CJB
next time i write a compleate sentence
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2017 19:46 Edited at: 2nd Feb 2017 20:19
Ha ha ^^^ well that was an unexpected turn..

Just updating here that I tested on my lunch break and indeed SetSpriteFlip is working fine!

Sorry for wasting folks time.

I must of had a bug someplace when I was first working on this a dev session or two ago.

Feel free to delete or change the title of the thread to NO BUG, etc.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Login to post a reply

Server time is: 2024-11-24 20:31:16
Your offset time is: 2024-11-24 20:31:16