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 / No -y in some phones

Author
Message
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 16th Nov 2022 19:46 Edited at: 16th Nov 2022 19:47
Ok so I am trying to grab the negitive y on my phone.

It works on my pc for a negitive grab for my pointer but not on my phone.

PointerY#=GetPointerY()

PointerY#>-20

Works on my laptop but not on my phone.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 16th Nov 2022 21:29
a couple of things to unpack here

GetPointerX/Y is a generic wrapper function and although has basic functionally on mobile you will run into problems

on desktop the pointer is a physical item that always has a position, mobile has no pointer, it is physically impossible for the pointer to be negative on a phone, the touch screen registers input in its area and this info is send to GetPointerX/Y, negative -20 means your finger missed the screen

Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 16th Nov 2022 23:51
Quote: " it is physically impossible for the pointer to be negative on a phone"


Ok, Good to know, thank you, Not I know I can not go yo high in my levels.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 17th Nov 2022 00:27
Well you can, if you move the scene with SetViewOffset the world y will be less than 0 but you need to employ the proper mechanics to determined mouse position or click/tap position, especially on mobile

please note ....

AGK Help wrote: "This is an emulated input method that uses whatever device inputs are available to produce a screen pointer. If the device has a mouse then this returns the current X position of the mouse. Otherwise the AppGameKit will check for a touch screen and, if found, will return the X position of the most recent touch event."


so if your last tap was at 100x100 and you call GetPointerX it will return 100 on mobile and the mouse x position on desktop .... its not that you cant go y high you just have to use the correct functionally IE: (GetRawTouchLastX/Y and WorldToScreenX/Y and ScreenToWorldX/Y)

Touch positions are in screen coordinates and sprite positions in world coordinates, you need to take this into account when using a world area bigger than or outside of the screen area



Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 17th Nov 2022 02:48
Quote: "so if your last tap was at 100x100 and you call GetPointerX it will return 100 on mobile and the mouse x position on desktop .... its not that you cant go y high you just have to use the correct functionally IE: (GetRawTouchLastX/Y and WorldToScreenX/Y and ScreenToWorldX/Y)"


Way to much extra work.

After months and months of work on this , well, no thanks. ha ha.
Game_Code_here
4
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 17th Nov 2022 02:56
Remember this?

Two years ago and took a long time

Well i have a well put together game now. I will show it soon.

Login to post a reply

Server time is: 2024-11-21 12:40:03
Your offset time is: 2024-11-21 12:40:03