Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [Request] Tutorial on Scroll Bars for GUI's
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
DrEinsteinium

[Request] Tutorial on Scroll Bars for GUI's

By DrEinsteinium, December 1, 2013 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

DrEinsteinium    1

DrEinsteinium

DrEinsteinium    1

  • Stone Miner
  • DrEinsteinium
  • Members
  • 1
  • 54 posts
Posted December 1, 2013

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.

  • Quote

Share this post


Link to post
Share on other sites

GotoLink    381

GotoLink

GotoLink    381

  • World Shaper
  • GotoLink
  • Members
  • 381
  • 2012 posts
Posted December 1, 2013

Have a look here

 

Override the mouse events, use some scrollPos variable...;)

  • Quote

Share this post


Link to post
Share on other sites

DrEinsteinium    1

DrEinsteinium

DrEinsteinium    1

  • Stone Miner
  • DrEinsteinium
  • Members
  • 1
  • 54 posts
Posted December 1, 2013

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?

 

 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6688

diesieben07

diesieben07    6688

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6688
  • 45727 posts
Posted December 1, 2013

I don't really have time to write a detailed tutorial, but you can look at my generic implementation of a Scrollpane. Supports buttons and all that shit :)

https://github.com/diesieben07/SevenCommons/blob/master/source/de/take_weiland/mods/commons/client/ScrollPane.java

  • Quote

Share this post


Link to post
Share on other sites

DrEinsteinium    1

DrEinsteinium

DrEinsteinium    1

  • Stone Miner
  • DrEinsteinium
  • Members
  • 1
  • 54 posts
Posted December 1, 2013

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

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Memory Heap Thingy!

      By diesieben07 · Posted 2 hours ago

      That's not what this thread is about... Make your own thread and post logs.
    • gudie73
      Memory Heap Thingy!

      By gudie73 · Posted 2 hours ago

      It gets stuck on that part and doesn’t change
    • gudie73
      Memory Heap Thingy!

      By gudie73 · Posted 2 hours ago

      Wym  
    • RaphGamingz
      ScreenGui does nothing

      By RaphGamingz · Posted 3 hours ago

      any errors?
    • RaphGamingz
      Game crashing when the block is activated

      By RaphGamingz · Posted 3 hours ago

      then you    your not assigning a value to the tileEntity try in the constructor tileEntity = world.getTileEntity(pos);
  • Topics

    • Mizinov
      7
      Memory Heap Thingy!

      By Mizinov
      Started August 24

    • Jaffaaaaa
      2
      ScreenGui does nothing

      By Jaffaaaaa
      Started Wednesday at 07:03 PM

    • jun2040
      5
      Game crashing when the block is activated

      By jun2040
      Started 19 hours ago

    • Merthew
      5
      [1.12.2] Multiple Structure Generation

      By Merthew
      Started November 7, 2018

    • Professional Derp
      16
      Server frequently crashes

      By Professional Derp
      Started 12 hours ago

  • Who's Online (See full list)

    • Neverless013
    • Yanny7
    • saxon564
    • Tomasukun
    • Ugdhar
    • dima.100
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [Request] Tutorial on Scroll Bars for GUI's
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community