MouseYPos code

This is a public forum, where you can find out everything you wanted to know about making games. Please don't use this forum as a place to recruit new members.

Moderators: adeyke, VampD3, eriqchang, Angelus3K

Post Reply
Message
Author
pass
Royal Servant Status
Posts: 129
Joined: Wed Mar 22, 2006 8:38 pm
Location: Israel

MouseYPos code

#1 Post by pass » Fri Apr 25, 2008 9:00 am

Is there some place I can find the code for popping up GUIs using MouseYPos visibility (such as the gIconbar)? I'm asking because I want to manipulate mouse icons according to a different variable whenever the gIconbar pops up. I can use repeatedly_execute to check Mouse.y, but I think that would unnecessarily slow down the game. Is there any way to enter code that will run right before the game is paused and gIconbar pops up?

Thanks!

pass
Royal Servant Status
Posts: 129
Joined: Wed Mar 22, 2006 8:38 pm
Location: Israel

#2 Post by pass » Tue May 06, 2008 6:10 am

So, does anyone have any idea, or would I have to use 'repeatedly_execute'?

My problem is that while the game is in eBlock and the cursor is set to Wait, if you bring up gIconbar (by moving the mouse up), the cursor changes to Pointer,  but then when the mouse is lowered again, it stays on Pointer and doesn't change back to Wait.
I was thinking of just changing the icon after gIconbar disappears, but that seems imposible. Any ideas anyone?

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#3 Post by Erpy » Tue May 06, 2008 7:11 am

What makes you think the game would be slowed down with merely a single mouse.y check? QFG2VGA's global rep_exec script is nearly 3000 lines long and many local rep_exec scripts have over 1000 lines. It's really not THAT easy to slow the game down with that script.

Image

pass
Royal Servant Status
Posts: 129
Joined: Wed Mar 22, 2006 8:38 pm
Location: Israel

#4 Post by pass » Tue May 06, 2008 4:30 pm

:lol  Thanks, that makes me worry a little less.  :p

pass
Royal Servant Status
Posts: 129
Joined: Wed Mar 22, 2006 8:38 pm
Location: Israel

#5 Post by pass » Sat May 10, 2008 8:10 pm

Is there some way to move the mouse? Because aparently mouse.x and mouse.y are read-only... (I only need mouse.y, BTW).

Thanks!

Erpy
Forum Administrator
Posts: 11434
Joined: Tue Sep 25, 2001 8:28 pm
Location: The Netherlands

#6 Post by Erpy » Sat May 10, 2008 9:18 pm

You should use the Mouse.SetPosition-function for that.

Image

pass
Royal Servant Status
Posts: 129
Joined: Wed Mar 22, 2006 8:38 pm
Location: Israel

#7 Post by pass » Sun May 11, 2008 5:30 am

Doh!
I knew I saw it somewhere... Thanks again!

Post Reply