-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|372|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Text and GUI's


 
HoboBen
Created : 13 December 2006
Edited : 13 December 2006
System : Windows
Language : Blitz

MouseIn Alternative

A slightly modified version of Jayenkai's



A slight elaboration on Jayenkai's Original, using four points, rather than two points plus lengths/widths...

Because I think this way!

 

Comments


Wednesday, 14 May 2008, 09:11
worchyld
Another MouseIn Alternative >
https://socoder.net/index.php?snippet=13694
Wednesday, 14 May 2008, 09:17
mike_g
Whats: => ?
Wednesday, 14 May 2008, 09:45
Jayenkai
"equal or bigger than.."

ie
0=>1 : False
2=>1 : True
1=>1 : Also True
Wednesday, 14 May 2008, 09:47
mike_g
Lol, I dident know you could do that in Blitz.
Wednesday, 14 May 2008, 11:18
Agent
Not good form calling the Mouse functions twice
Wednesday, 14 May 2008, 13:38
Orion Pax
Yeah...i Agree with Agent Smith. Even as fast as blitz runs its still possible if the mouse is moving for it to give you 2 different values for mousex and mousey. You would have to be throwing the mouse around but its still possible. How about adding 2 more params as defaults...like this...



This way you will have the same value for the mousex and mousey, and you dont have to include it when calling your function as it sets its own default value.

Wow...i did gooooood....lol
Wednesday, 14 May 2008, 14:57
Jayenkai
Or even better, define MX and MY as globals, along with MSX, MSY, MSZ and MZ, and then get them all defined in a "Framerate" function that also does your flips, and other Base things.
..



But, of course, in 99% of realistic cases this won't make a blind bit of difference, and will just be overdoing things.
Wednesday, 14 May 2008, 17:15
JL235
Plus, then your using globals.
Monday, 19 May 2008, 23:28
HoboBen
@Smith, yeah, I know. In my defence, I wrote this ages ago (there's no date! |edit| Wha..? Ooops!! |edit|) when the best optimiser certainly wasn't between my ears.
Friday, 23 May 2008, 12:20
Andy_A
I would just use a "Point in Polygon" function. That way you could check just about any irregular shape defined by 3 to 20 points.

https://socoder.net/index.php?snippet=13838