Ok here is some code showing the problem.
Code:
public class ThingleTest {
public static void main (String[] args) throws SlickException {
BasicGame game = new BasicGame("ThingleTest") {
Page page;
Image testImage;
public void init (GameContainer container) throws SlickException {
testImage = new BigImage("testdata/logo.png");
Thingle.init(new SlickThinletFactory(container));
page = new Page();
page.setDrawDesktop(false);
page.enable();
try {
Widget widget = page.parse("<panel background='#66000000' top='100' left='100'>" //
+ "<dialog text='Alert' modal='true' width='200' height='200'"
+ " resizable='true' columns='1' gap='10' pad='10'>" //
+ "<textarea focusable='false' wrap='true' weighty='1' weightx='1'" //
+ " background='transparent' border='false' colspan='2'" //
+ " text='This is my super important message dialog for telling users about things.' />" //
+ "<panel gap='10' colspan='2' halign='right'>" //
+ "<button text='OK' /><button text='Cancel' />" //
+ "</panel>" //
+ "</dialog>" //
+ "</panel>");
page.add(widget);
} catch (ThingleException ex) {
ex.printStackTrace();
}
Graphics g = container.getGraphics();
g.setBackground(Color.white);
}
public void update (GameContainer container, int delta) throws SlickException {
page.update(delta);
}
public void render (GameContainer container, Graphics g) throws SlickException {
g.drawImage(testImage, 100, 100);
page.render();
}
};
AppGameContainer container = new AppGameContainer(game);
container.setDisplayMode(600, 800, false);
container.start();
}
}
* Move the dialog around and observe the wacky clipping. Turns out the BigImage is what is doing it! Doesn't make much sense. BigImage#draw resets the scale and translate. Change BigImage to Image though, and you'll see the problem goes away.
* Sizing the dialog very small, the buttons and scrollbars are drawn outside the bounds of the dialog. This isn't that big of a deal since a minimum size can be used, but I'm not sure if it should be clipping and if so there may be some scenario where it looks bad.