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.

Code Snippets / Mousewheel scrolling menu

Author
Message
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 1st Jun 2006 08:54
Hello

I am working on a function to create a menu window that can be scrolled through using the mouse wheel. Its not a full function yet but here is the code. I am going to make some adjustments to make it more universal but I thought someone might find this useful. Let me know if you do



You can copy this to a text file and name it spells.txt or whatever


Its just a list I was using to test the code
Carolina South
20
Years of Service
User Offline
Joined: 28th Sep 2004
Location: South Carolina
Posted: 1st Jun 2006 21:03
That's pretty neat!

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock." - Will Rogers

"The secret to creativity is knowing how to hide your sources." - Albert Einstein
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 6th Jul 2006 02:18
Thanks! You just notified me that there is indeed a Mousez() command that can be used for something! Oh, and to obtain a better effect with the scrolling (currently when you scroll the mouse up, the list goes down) just change...

start=mousez()/120
into...
start=mousez()/-120


==Cool code!

I doubt you can draw me/60 by hand, so you REALLY can't draw ME/1, can you? Okay, you do that. Just tell me when you're done, I'll be someplace else having a life.
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 6th Jul 2006 03:50
True. I made it that way like you are pulling the page down from the top or pushing it up cuz that is how I usually set things but come to think of it I don't think that is the default.

http://www.cafepress.com/blackarrowgames
Check out my great stuff here
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 28th Jul 2006 06:22 Edited at: 28th Jul 2006 06:45
Nice. I've copied this to my projects folder since it will be educational. A reservation i have is that you when you continue to scroll the mouse wheel past the end of the list, you need to scroll it back the same number of times before the list will move again. I suggest changing the appropriate line to:

start=start+mousemovez()/120


You'll be able to click on this someday.
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 28th Jul 2006 07:18
Excellent point Tank. Thank You.

http://www.cafepress.com/blackarrowgames
Check out my great stuff here
Wolf Dreamer
19
Years of Service
User Offline
Joined: 13th Sep 2005
Location: the land of chaotic dreams
Posted: 29th Jul 2006 11:07
Very cool. And highly useful.

I am greatful people as generous as you don't mind sharing code that aids the rest of us in our development. May the penguin be with you.

the last sane human being in a world gone mad
Hobgoblin Lord
19
Years of Service
User Offline
Joined: 29th Oct 2005
Location: Fall River, MA USA
Posted: 29th Jul 2006 11:54
And also with you

http://www.cafepress.com/blackarrowgames
Check out my great stuff here

Login to post a reply

Server time is: 2024-11-23 03:24:26
Your offset time is: 2024-11-23 03:24:26