Lemur resize border

Try setting the font size really small. I guess since you are using buttons that the text has some height constraints when determining preferred size.

I think there probably are better ways to do this though your approach is pretty clever.

Another approach would be to build a ResizablePanel type class that forces a particular background component that is your resize borders. The GUI content could then be a child panel. You could then just add a mouse or cursor listener to yourself to detect when dragging on the borders is happening.

The RollupPanel might be a good example of a GUI element that manages a child.

I recommend using a CursorListener for mouse clicking because it will give you the actual collision information… which can be useful for verifying that your own background was what was clicked and where it was clicked.

Else your current approach is probably the easiest if you can get your sizing stuff worked out.

1 Like