t0neg0d scroll areas not functioning?

I am trying to use a t0neg0d scroll area in non-text-mode. However, no matter what I do or what order of operations occurs, the contents of the scroll area are neither clipped, nor does the VScrollBar ever appear. It works as expected in text mode. Is this capability currently missing?

Thanks,
Richard

@rpcesar said: I am trying to use a t0neg0d scroll area in non-text-mode. However, no matter what I do or what order of operations occurs, the contents of the scroll area are neither clipped, nor does the VScrollBar ever appear. It works as expected in text mode. Is this capability currently missing?

Thanks,
Richard

I’ll test it here… can you throw together a small testcase to show the problem while I’ll try and repro it?

EDIT: I can’t repro this… however, it sounds like the clipping layer isn’t being set. Once you have the test case posted, we should be able to get this resolved right away.

Sure thing, FYI, I got the “clipping” portion working by manually calling setControlClippingLayer, which seems to work. but still no scrollbar visible. Note that element.getVScrollBar().getIsVisible() returns true as well. Just is never drawn?

Here is the wrapper class I am using (sizes elements to stretch across the control when added to fill horizontally ). Note its basic and simply does some wrapping of addScrollableChild to resize the element to the proper size, but makes no changes to the construction of its super class.

Here is the logic in using it

@rpcesar said: Sure thing, FYI, I got the "clipping" portion working by manually calling setControlClippingLayer, which seems to work. but still no scrollbar visible. Note that element.getVScrollBar().getIsVisible() returns true as well. Just is never drawn?

Here is the wrapper class I am uses (sizes elements to stretch across the control). Note its basic and simply does some wrapping of addScrollableChild to resize the element to the proper size.

Here is the logic in using it.
ScrollableRepeator repeator = new ScrollableRepeator(screen, Vector2f.ZE - Pastebin.com

Ok… the scroll area doesn’t like being added directly to the screen (why…? not sure…), but for now, I would suggest putting it inside of another element… even if you create one that is not visible and fills the screen:

[java]
Panel p = new Panel(screen, Vector2f.ZERO, new Vector2f(screen.getWidth(),screen.getHeight()));
p.setAsContainerOnly();
p.addChild(repeator);
screen.addElement(p);
[/java]

Couple other suggestions… extend the ScrollAreaAdapter as it automatically resolves some of the issues you will likely hit using ScrollArea directly. The original ScrollArea class was not written very user friendly and requires you to setup a lot of peripherals manually–like clipping bounds and such.

You can also use ButtonAdapter to shorten up your code a bit, just overriding the methods you actually need.

Thanks for the response. Ill give putting it into another element a go.

I didn’t see much in the way of docs on the adapters , so I hadn’t played with them. Ill certainly take a look at that as well.

@rpcesar said: Thanks for the response. Ill give putting it into another element a go.

I didn’t see much in the way of docs on the adapters , so I hadn’t played with them. Ill certainly take a look at that as well.

The documentation for the entire library is WAAAAAY out of date and needs an overhaul. Now that I finally finished up with the was impending surgery, as soon as I am back on my feet a bit more, I’ll be resolving the outstanding issues and redoing the documentation.

Getting some really weird results.

I created a panel, and added it to the panel. When I turned off the clipping areas, i see the scrollbar, but the results are not clipped. If I turn on the clipping I see the results, no scrollbar, and nothing is clipped. Even when the scrollbar is visible, it desent work right. It shift things down about 40pixels when clicking down, but up does not work, and its not scrolling down, but shifting things down from the top.

Here is what I am seeing (note I am using a full screen panel initialized like you have)
Imgur

@rpcesar said: Getting some really weird results.

I created a panel, and added it to the panel. When I turned off the clipping areas, i see the scrollbar, but the results are not clipped. If I turn on the clipping I see the results, no scrollbar, and nothing is clipped. Even when the scrollbar is visible, it desent work right. It shift things down about 40pixels when clicking down, but up does not work, and its not scrolling down, but shifting things down from the top.

Here is what I am seeing (note I am using a full screen panel initialized like you have)
Imgur: The magic of the Internet

Hmmm… try setting the clipping on the scrollableArea instead of the entire control…

repeator.getScrollableArea().setClippingLayer(repeator);

I’ll try a few things here in the meantime. It’s been quite a while since I built anything using the ScrollArea or ScrollAreaAdapter.

heh, i just switched it to extend from the scrollableadapter and it seems to be working (within the panel)

even more cute, I didn’t have to add it to a panel at that point.

is the new methodology pretty much to extend from the adapter classes then?

since you mentioned the docs were heavily out of date, i would be interested in the proper mindset.

Thanks,
Richard

@rpcesar said: is the new methodology pretty much to extend from the adapter classes then?

since you mentioned the docs were heavily out of date, i would be interested in the proper mindset.

Thanks,
Richard

The adapter class will just take care of a few things that the other doesn’t… however… it still seems rather finicky. I really need to look into rewriting this eventually. It’s just not a very use friendly control. The flipped y axis makes it really difficult to place things properly. I’m fairly sure the the internal rebuild for the scroll-able area has an issue… but what that is, I’m not sure atm.

Unrelated, but while I have you in the discussion…

What property is it that defines the portion of the texture which does NOT scale?

@rpcesar said: Unrelated, but while I have you in the discussion..

What property is it that defines the portion of the texture which does NOT scale?

The resizeBorrders do this… a Vector4f defining the # of pixels per side to not scale. The rest of the image inside of this is stretched.

EDIT: I believe it is: x = w, y = n, z = e, w = s

EDIT 2: You can set this to Vector4f.ZERO if you just want the entire thing to stretch

Yep… brain is not working today.

I had another thought about the scroll areas and that is to take a look at how I put together the Menus… they add both checkboxes and icons to show the expand arrow… so it uses both text and other elements and seems to work fine. This may give a hint as to how to best use the scroll area or adapter.

@rpcesar

A heads up… I just committed the first draft of a new ScrollArea substitute–ScrollPanel.

It is much easier to use… though, I still need to hook up mouse wheel support and fling scrolling. And I also need to work it a bit for text-based content. However, it works reliably for element based content and also has both vertical and horizontal scrolling and also works at the screen level as well as nested. Over the next couple days I’ll likely have this finished up and available through the plugin, however, you can currently grab the 3 added classes from the repo if you are pulling the sources from there.

1 Like

great, the moment I have it all playing decent you throw a curveball ;). I had to do a considerable amount of fandangling but already have more complex types built upon your primitives.

Imgur

For the record, I have included the source for how I am currently using the ScrollArea. I’ll look over your replacement as soon as I can prioritize it, but feel free to use it if you need something to test feature regressions.

1 Like

Zomg, nested scrolls and horizontal scrolling… the 2 thingies top of my xmas list :).
Absolutely not stopping me in my dev btw, just great stuff to add whenever it’s ready.

1 Like
@loopies said: Zomg, nested scrolls and horizontal scrolling... the 2 thingies top of my xmas list :). Absolutely not stopping me in my dev btw, just great stuff to add whenever it's ready.

There are a few limitations to ScrollPanels nested within ScrollPanels:

  1. The child ScrollPanel has to be a fixed size
  2. If the parent ScrollPanel resizes, scrollToTop() and scrollToLeft() have to be called on the child ScrollPanel.

Hopefully I find a way around these two issues. But… eh… it’s better than it was!

EDIT: I’m also looking into handling nested clipping… so far, it’s nothing more than an idea I hope works.