Scroll Bars?

Non-platform specific questions.

Scroll Bars?

Postby Hblade » Wed Mar 24, 2010 5:04 pm

Hey, would anyone like to tell me how I could take something that a canvas is drawing from, (say, a 320 x 280 size canvas or something is drawing a 1024x768 size image), and make scroll bars for it? The scroll bars can be canvas also for all I care, I just wanna know if it's possible.
Attachments
a.JPG
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Scroll Bars?

Postby Thanx » Mon Apr 05, 2010 8:36 pm

If I understand well, then you're simply asking for a scrollbar... any kind possible...
Create something that goes as a bar, and make 3 other things/images: A button that points up, and one that points down (or left and right, doesn't matter). Put those on the end of the bar. The last thing is the scroll, or the rectangle, or whatever, that should be something scalable, so I advise a canvas, the size of the bar, minus the two ends.

Then you calculate with these factors: What's the visible height or width? What is the actual widht/height? The proportions they have to each other, gives the proportions of the scroll, to the lenght of the bar itself, and that's what you should use for canvas drawing.
The onclick of the buttons at the ends should change the view's position, while these things are parented. The other option is, that they change the position of the actor(s) viewed, but then if the scrolled area is not the whole window, you need an actor to frame it all.
Then use the positions of the viewed actors and the view itself to determine where you are viewing these actors, which determines where to paint the scroll thing itself, and determines wether the buttons should enable any scrolling. To enable the dragging of the scroll I don't know what to do, but it must be something similar....

Hope that helps...
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: Scroll Bars?

Postby Hblade » Mon Apr 05, 2010 9:03 pm

Thanks :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest