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 / getpointerpressed problem

Author
Message
Uechi
17
Years of Service
User Offline
Joined: 2nd Sep 2006
Location:
Posted: 26th Jun 2012 18:57
I am trying to swap two sprites by pressing a mouse button. My problem is that getpointerpressed seems to stayon
After I click on the first Sprite so the check for clicking on the second Sprite takes affect before I even click on it. I have checked for getpointerreleased but it didn't do anything. Has anyone had this problem? Any solutions?
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 26th Jun 2012 19:04
Uechi, GetPointerPressed() returns 1 on the initial press only. It should not remain as 1. Could you show us what you have coded and we may be able to figure it out...
Kobaltic
12
Years of Service
User Offline
Joined: 24th Jan 2012
Location: PA, USA
Posted: 26th Jun 2012 19:57
I noticed this happens to me a lot. I make the second sprite somewhere else on the screen so it can't be pressed right away. Also getPointerReleased works in my programs. Post some code.
Uechi
17
Years of Service
User Offline
Joined: 2nd Sep 2006
Location:
Posted: 26th Jun 2012 20:45
I was calling getpointerpressed twice. I modified some code and it is working fine now. thanks for the help and suggestions.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 26th Jun 2012 21:28
Calling getpointerpressed twice in the same sync cycle will return exactly the same value both times.

As you probably discovered, you need to allow at least one sync cycle between calls for the two different locations to register.

I'm glad you got it working.

Happy Programming!

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-05-02 12:09:03
Your offset time is: 2024-05-02 12:09:03