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 / end command exit app?

Author
Message
dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 12th Jul 2020 04:48
im trying to create a way to close out of my app on android. i created a sprite that is a simple exit image and call end when its clicked or touched but it doesnt work
Heavens
8
Years of Service
User Offline
Joined: 10th May 2015
Location:
Posted: 12th Jul 2020 08:50
Does it just do nothing?

You are missing the screentoworldY command on the Y value

dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 12th Jul 2020 15:40 Edited at: 12th Jul 2020 15:40
Heavens. Yes it just doesn't do anything, not even stop the app from working.
Quote: "You are missing the screentoworldY command on the Y value"
yeah my game scrolls only the x position . Should i still add it?
Heavens
8
Years of Service
User Offline
Joined: 10th May 2015
Location:
Posted: 12th Jul 2020 16:41
Its best to still call screentoworldY on the Y value if its not needed it wont hurt.

Are you sure the code is being called? Can you show more of the code?

Here is a quick example for you to test



dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 12th Jul 2020 18:33
thank you for the example it turns out it does work of course lol but only if i click the very top left of my sprite unlike the other sprites i have set up as gethittest that work where ever i click on it
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 16th Jul 2020 09:53
do you need to convert to world space? the help file is a bit weird on that command as it says you do but then the example they give doesn't...
if GetPointerReleased()
if GetSpriteHitTest(test,GetPointerX(),GetPointerY())
end
endif
endif

if you are scrolling with the camera offset perhaps works?
if GetPointerReleased()
if GetSpriteHitTest(test,GetPointerX()+GetViewOffsetX(),GetPointerY())
end
endif
endif
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
dandrews
3
Years of Service
User Offline
Joined: 26th Jun 2020
Location:
Posted: 17th Jul 2020 05:17
smallg yes it is a scrolling game. convert to world space? is that different then screentoworld?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Jul 2020 05:58 Edited at: 17th Jul 2020 05:59
2019.12.16 wrote: "Reverted fix to GetSpriteHitTest and GetSpriteHit which changed previous functionality, use the ScreenToWorld commands when using SetViewOffset instead"
[My Itch.io Home]
[CODE lang=AGK] Your Code Here [/CODE]
[VIDEO=youtube] VideoID [/VIDEO]

Login to post a reply

Server time is: 2024-03-29 10:40:37
Your offset time is: 2024-03-29 10:40:37