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 Studio Chat / SetViewOffset() cause button input issues on android

Author
Message
Hughbus
AGK Backer
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location:
Posted: 1st Oct 2019 13:15
Seems to be an issue only on Android device, not iOS -
When using SetViewOffset() to scroll a sprite based level, the hitboxes for virtual buttons also get moved even though the virtual button visual is still fixed to the screen correctly. Id expect the hitboxes to remain with the screen/virtual button visual, not offset with the rest of the 2d sprites.

blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Oct 2019 23:09
So you're using FixEditBoxToScreen() and they are still moving?
Hughbus
AGK Backer
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location:
Posted: 2nd Oct 2019 13:17
I'm having the problem with virtual buttons, not edit boxes. I couldn't find a similar function for virtual buttons. It is strange because although the visual of the button is static, the hitbox that recognises presses, etc. is moving with the rest of the game sprites.

Actually seems to be an issue on windows as well. seems to work as expected (hotboxes and buttons stay in the same position) on ios on possibly my mac only
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Oct 2019 16:20
This works fine for me
the button stays in the same place and does not move
the background sprites all move with left/right arrows
I cant get the button to fail
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 6th Oct 2019 23:52 Edited at: 6th Oct 2019 23:53
Actually the same thing happened for me.. The fix around is to do this to every button




if you have a button that you set like this:




You have to put this every time you use SetViewOffset()

Hughbus
AGK Backer
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location:
Posted: 11th Oct 2019 14:38
Ah cool, so its not just me - was thinking I was crazy. It does work without this code on my iPhone and mac, however the same project on android and windows needs this correction every time I use SetViewOffset(). I assume its a bug of some sort then since its behaving different on various platforms?
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 13th Oct 2019 04:05 Edited at: 24th Oct 2019 13:03
Absolutely
Quote: "
Ah cool, so its not just me - was thinking I was crazy. It does work without this code on my iPhone and mac, however the same project on android and windows needs this correction every time I use SetViewOffset(). I assume its a bug of some sort then since its behaving different on various platform"


The controls do seem flawed in doing this work around.. They seemed much smoother before this bug.. Im hoping they fix this instead of pushing it to then backburner..

Login to post a reply

Server time is: 2024-04-20 09:53:20
Your offset time is: 2024-04-20 09:53:20