Hi,
I'm working on integrating TWL into my game which is written with LWJGL. My game window is resizalble:
Code:
Display.setResizable(true);
I've added a button to my display, like this:
Code:
button = new Button("!!");
button.setTheme("button");
button.setEnabled(true);
button.setVisible(true);
add(button);
And in my "draw" loop, I have the following code:
Code:
if (Display.wasResized()) {
GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight());
gui.adjustSize();
}
And I also have the following layout() function defined:
Code:
@Override
protected void layout() {
button.setPosition(15, this.getHeight() - 50);
button.setSize(35, 35);
}
But when I resize my game window, the button (including the text) stretches. (See the attached screen shot to see what I mean.) I'd like the button to stay the same size instead. How do I go about doing that?