Hi,
I’ve been playing with this GUI today, and it’s been great so far, but I’m having a problem getting ScrollArea to work. When I create a text-only ScrollArea, the text scrolls properly, but the display overflows the vertical bounds of the ScrollArea. If I create a non-text-only ScrollArea and add text to the scroll element, the text clips correctly, but I don’t get a scrollbar. Screenshot
Since I’m using this package for the first time, I am sure I’m just missing something simple - any help spotting it would be great. Here’s my code (simpleInitApp() in a new jMonkey project):
[java]
public void simpleInitApp() {
flyCam.setEnabled(false);
Screen screen = new Screen(this);
screen.initialize();
guiNode.addControl(screen);
ScrollArea scroller = new ScrollArea(screen, "scr1", new Vector2f(50, 50), new Vector2f(200, 200), true);
for (byte i = 0; i < 15; i++) {
scroller.setText(scroller.getText() + "what a long text string this is!");
}
ScrollArea scroller2 = new ScrollArea(screen, "scr2", new Vector2f(450, 50), new Vector2f(200, 200), false);
Element area = scroller2.getScrollableArea();
for (byte i = 0; i < 15; i++) {
area.setText(area.getText() + "what a long text string this is!");
}
screen.addElement(scroller);
screen.addElement(scroller2);
}
[/java]
Thank you!