GetMouseState() ?? Please Help me!

Talk about making games.

GetMouseState() ?? Please Help me!

Postby Rufus 01 » Thu Oct 28, 2010 10:25 pm

Hi, I need help and don't know if it possible with GE...

I want to have a action when I klick on a Actor (Mouse Button Down), the problem with it is the following: when I let the Mousekey pressed and moving down from my actor the state doesn't change, I have a Mouse button Up Event, that should get Activated when u moving down from the actor also with pressed down Mousebutton...

I think the Problem is that only when the Mouse Button will pressed down the xmouse & ymouse will be checked...

I hope u all understand what I want to say and u could help me... Thanks
Was geht'n? =D
Rufus 01
 
Posts: 73
Joined: Sun Aug 27, 2006 9:51 am
Location: Lisbon, Portugal
Score: 3 Give a positive score

Re: GetMouseState() ?? Please Help me!

Postby SirAz » Thu Oct 28, 2010 11:14 pm

Hmm. I think I know what you mean. If you just use the MOUSEDOWN/MOUSEUP events on your actor, the program only understands that you are unclicking an actor if the cursor is touching. Its like, when you click a button but move the cursor away, then unclick, the button doesn't activate, right? I had the same problem. I had to use filled area actors that correspond to sections of the screen, activating when the mouse enters and then registering clicks. When the mouse unclicks, the main area registers it as a Mousedown = 0 variable, so all of the buttons are deactivated in a script. If you want a full tut I can, but does that help so far?
User avatar
SirAz
 
Posts: 23
Joined: Fri Oct 01, 2010 10:47 pm
Location: United Kingdom
Score: 2 Give a positive score

Re: GetMouseState() ?? Please Help me!

Postby Rufus 01 » Fri Oct 29, 2010 7:54 pm

I'm using filled Actor regions, but when u are using this on ipod and using the touchpad and i moving my finger over the screen the xmous & ymouse doesn't changing.
It will only "save", in example xmouse = 50; and when u are moving your finger over the screen the xmouse = 50; will not change.... :roll:
Was geht'n? =D
Rufus 01
 
Posts: 73
Joined: Sun Aug 27, 2006 9:51 am
Location: Lisbon, Portugal
Score: 3 Give a positive score

Re: GetMouseState() ?? Please Help me!

Postby skydereign » Fri Oct 29, 2010 11:09 pm

Not entirely sure what the problem is, but it sounds like you want your mouse button up event to trigger when you are no longer within the actor you initially clicked. That is to say when the mouse leaves the actor. If so the mouse leave event might be what you are looking for.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: GetMouseState() ?? Please Help me!

Postby Rufus 01 » Sat Oct 30, 2010 2:19 am

What I need is, when The Mouse Button is pressed down and I leef the Actor with the mouse the Mouse button up event need to be activated...
Was geht'n? =D
Rufus 01
 
Posts: 73
Joined: Sun Aug 27, 2006 9:51 am
Location: Lisbon, Portugal
Score: 3 Give a positive score

Re: GetMouseState() ?? Please Help me!

Postby NERDnotGEEK » Sat Oct 30, 2010 2:47 am

i think i understand what you mean?
so you mouseup event should also happen if you leave the actor with your mouse?
im not sure but its a guess at what you want :) here have a look at this demo and tell me if its what you want rufly :)

just click on the lower ge face thingy, thats your button
Attachments
buttonlight.ged
(1.47 KiB) Downloaded 84 times
NERDnotGEEK
 
Posts: 75
Joined: Sat Oct 30, 2010 1:48 am
Score: 12 Give a positive score

Re: GetMouseState() ?? Please Help me!

Postby skydereign » Sat Oct 30, 2010 2:59 am

Yeah, so what you wanted was the mouse leave event, like in NERDnotGEEK's example.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest