I have created a ScrollPane but there is no bar to scroll with (like the one on the side of your browser) you have to drag with your mouse. How can I get a scroll bar?
What I did to add a scrollbar was use libgdx's ScrollPane.ScrollPaneStyle to set the scroll bar as a ninepatch.
ScrollPane.ScrollPaneStyle scrollStyle;
/...
scrollTexture = new Texture(Gdx.files.internal("Scroll9.png"));
scrollNine = new NinePatch(new TextureRegion(scrollTexture,6,6),2,2,2,2);
then I created the vertical scroll knob
scrollStyle = new ScrollPane.ScrollPaneStyle();
scrollStyle.vScrollKnob = new NinePatchDrawable(box);
and applied the style to my scrollable table
scroll = new ScrollPane(test, scrollStyle);
source: http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.ScrollPaneStyle.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With