Jump to content

[Request] Tutorial on Scroll Bars for GUI's


DrEinsteinium

Recommended Posts

Hey everyone,

 

I have been trying to add a scroll bar to my GUI for a while now but with no luck, and I was curious if someone would take the time to write a detailed tutorial for it. I and many other would appreciate it, and it would be a great contribution to the community.

 

As for what it's scrolling through, you could have it scroll through anything from a list of GUI slots to a list of GuiButtons, or even a list of pictures. :) Thank you so much.

Follow me on twitter! @keepablock

Read up on whats new! www.catacombs.co

width=700 height=60http://electronic-chronic.com/assets/keep-a-block/wikilink/wikilink_logo.png[/img]

Link to comment
Share on other sites

Thanks for the example. I've gotten the mouse wheel to work but I'm a little bit confused with the actually clicking and dragging of the scroll bar. Can you explain how it works?

 

 

Follow me on twitter! @keepablock

Read up on whats new! www.catacombs.co

width=700 height=60http://electronic-chronic.com/assets/keep-a-block/wikilink/wikilink_logo.png[/img]

Link to comment
Share on other sites

I've seen yours ben. You inspired me to make mine into a widget, however mine isn't as fancy as yours, because you clip the buttons >.>; <3

 

Here is my git. I managed to get the click/drag working with the built in methods of GuiContainer. Now I just have to write the algorithm to scroll through my buttons.

 

https://github.com/DrEinsteinium/WikiLink/blob/master/com/dreinsteinium/wikilink/gui/GuiContainerMenu.java

https://github.com/DrEinsteinium/WikiLink/blob/master/com/dreinsteinium/wikilink/gui/widget/WidgetScrollPane.java

Follow me on twitter! @keepablock

Read up on whats new! www.catacombs.co

width=700 height=60http://electronic-chronic.com/assets/keep-a-block/wikilink/wikilink_logo.png[/img]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.