123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|400|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Button positioning program?

Sun, 02 Aug 2009, 02:33
LostUser
Button unresponsiveness
=======================

I've just noticed that mousehit(1) is really unresponsive!

I've cut my code down to the bare minimum:



What I find is that sometimes MouseHit(1) either:

1) doesn't work even if I press it loads of times,
2) cache's the return, even if I try to flush the mouse

I've tried replacing it with MouseDown(1), this works fine -- but it causes a problem, that being you can hold mouse button and it will assume you've clicked a button.

I've tried the following:



How do I make mousehit(1) more responsive to mouse clicks?

Many thanks




Sun, 02 Aug 2009, 02:52
shroom_monk
I always found it to have good responses... the important thing to remember is that as soon as you get the value to Mousehit(x), that will reset to 0 (same applies to Keyhit(x)). So if in one loop you say



then the 'Hello!' will never show, unless the user clicks inbetween processing the 1st and 2nd lines. Instead, set Mousehit(1) to a variable, to make sure it isn't being flushed before processing.

|edit| Yes, that looks like the problem. You're calling Mousehit(1) at the start of your button loop. Which means it only works for the first button in your list. That is the cause of the unresponsiveness. Set Mousehit(1) (and also MouseX() and MouseY()) to variables before the loop, and use those instead. That should fix your problem. |edit|

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Sun, 02 Aug 2009, 03:25
Jayenkai
Warning : Advice about using Globals approaching!

What I tend to do, is set a Global MH, right at the top, and then make my own Flip function.



Then use FlipMe wherever you normally use Flip, and MH will take the place of the regular one.

Feel free to add MH2 for the rightbutton.

-=-=-
''Load, Next List!''
Sun, 02 Aug 2009, 04:10
LostUser
Hi there, I will try your ideas! Thanks!
Sun, 02 Aug 2009, 16:07
mindstorm8191
Mousehit isn't designed to work with continuous mouseflushes. If you flush the mouse every frame any clicks you made last frame will be ignored. The only real reason you should use flushmouse is when you change display screens, remove something the user was holding, or something similar.

-=-=-
Vesuvius web game