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 / Scrolling Menu (using the finger)

Author
Message
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 26th Feb 2017 05:50
Hi everyone.

I want to develop a scrolling menu where we can slide the menu options with the index finger.

That's the best I could get so far:



The result is not smooth as scrolling in a phone. It seems the phones have an "inertia" feature so the objects keep moving after you slide. I'm sure you can come up with something much better.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Feb 2017 10:37
maybe like this?
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 26th Feb 2017 15:01
Looks awesome, Markus!! Thanks!!

The only problem I found is that if we keep clicking in the end in a static point it keeps scrolling.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Feb 2017 17:09
you mean if you will just click without scroll?
i try to stop the movement here if the distance the finger moved is to small.
Quote: "if Abs(Offset)<8 then Offset=0"
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 26th Feb 2017 18:07
I mean, let's say we click on 0,0 and move the cursor to 128,0 and then stop moving but keep clicking (like staying with the finger pressed but not moving). Right now the sprites are moving continuously.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 26th Feb 2017 21:49
then in pointerstate the
ClickX1=GetPointerX()
need a update after some milliseconds
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 26th Feb 2017 23:02
I was thinking about that. In order to do the update after the milliseconds, you think the best method is to set a timer?

Thank you.
hoyoyo80
8
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 27th Feb 2017 10:33
Hope can get a code for scrolling gui from this topic
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Feb 2017 12:20 Edited at: 27th Feb 2017 12:28
this way.
(the logic can now be simplified.)


@hoyoyo80
you just need a modul which handle the input for your needings.
i made a slider bar example, you can find here in this agk threads or in online help examples.
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Richard_6
7
Years of Service
User Offline
Joined: 3rd Feb 2017
Location:
Posted: 27th Feb 2017 16:00
Works well now! Thanks!!

Login to post a reply

Server time is: 2024-11-17 17:03:39
Your offset time is: 2024-11-17 17:03:39