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


 
mike_g
Created : 04 March 2007
 

Scrollbars



Heres a pair of functions I posted on dev-crunch. But since its gone i figured i may as well put em here. Once function does a vertical scrollbar, the other a horizontal one. They work pretty much perfectly as long as you dont use more than one of each type at a time. Oh and they are not exactly very nice to look at either.

 

Comments


Sunday, 04 March 2007, 13:08
shroom_monk
Pretty good, except that when you try to drag one of the bars, it doesn't move at the same speed as the mouse.
Sunday, 04 March 2007, 13:30
garand
yes
Sunday, 04 March 2007, 16:24
steve_ancell
I've been playing around with this sort of stuff for a few days. You will need to provide your own image for the mouse pointer.

The get_slider_value(id$) function returns a number between 0 & 100, which represent a percentage of the slider. To get the names of the bars, look at the function create_slider_bars().



|edit| I forgot to mention the bar_type element in the slider_bar Type is 1 for horizontal, and 2 for vertical. |edit|

|edit| I also forgot to say, feel free to rip this code apart and use in anyway you like. |edit|
Sunday, 04 March 2007, 16:48
mike_g
Hmm... When I move the sliders nothing seems to scroll.
Sunday, 04 March 2007, 17:07
steve_ancell
That's because it's not been done yet. I will keep you posted.

If you include the line after the color statement in the main loop, it will show the percentages the sliders have moved across the bars.
Sunday, 04 March 2007, 17:08
mike_g
Cool, well what you got so far looks promising
Sunday, 04 March 2007, 17:12
steve_ancell
Cheerz Bro... just incase you were wondering, it's going to be a tilemap editor that can manage animated backgrounds. And yes, I will post it on here as FreeWare.
Monday, 05 March 2007, 19:46
power mousey
ahhhhh steve

that looks and sounds really good.

As the power mouse, I can't wait to try it out.
And hey, animated backgrounds. Sounds really cool and from a sixties throwback..really groovy man

now, I gotta go back to work.
So, hey.....

Now its time to say goodbye
to all my socoder friends and others too..

So--> so what
co--> rather be a Ceo instead
der..and thats alllllllll.

cheers,