@t0neg0d said:
Do me a favor and try adding the window prior to resizing it. Though, this shouldn't be an issue. Out of curosity, what OS are you using?
For the other issue, is the window being dragged? Or is it resizing when you grab on of the corners? If it is resizing, just set win.setIsResizable(false);
You can add buttons or other controls to anything you like. The screen directly, a window, a panel, another element, a button (though, I’ve never tried adding a button to another button… it should work fine).
EDIT: Oh… I see an issue in the code you posted…
no need to call screen.initialize() anymore and… you need to add the screen as a control to the gui node:
[java]
guiNode.addControl(screen);
[/java]
EDIT 2: ignore the last bit… my eyes are apparently playing trikcs on me.
Okay so here’s how we stand.
-
I apparently didn’t realize what I was doing, so I guess it wasn’t moving, just re sizing itself (If I drag it all to one side it doesn’t disappear now but I thought it did before, weird…[yay fairies…])?
-
setting the resize off works, but I noticed that when I add it to the screen beforehand another weird issue occurs.
[java] Window panel = new Window(screen, new Vector2f(0,0));
screen.addElement(panel);
panel.setDimensions(settings.getWidth(), settings.getHeight());
panel.setIsMovable(false);
panel.setIsResizable(false);
// screen.addElement(panel);[/java]

-
When setting it in the constructor it works.
[java] Window panel = new Window(screen, new Vector2f(0,0), new Vector2f(settings.getWidth(), settings.getHeight()));
// screen.addElement(panel);
// panel.setDimensions();
panel.setIsMovable(false);
panel.setIsResizable(false);
screen.addElement(panel);[/java]
-
I have another issue now where the button text isnt’ centered after I increase size.
[java]
ButtonAdapter register = new ButtonAdapter(screen, new Vector2f((settings.getWidth()/2f), settings.getHeight() * 0.30f), new Vector2f(200,80))
{
@Override
public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled)
{
}
};
register.setPosition(register.getPosition().x-register.getWidth()/2f, register.getPosition().y);
register.setText("Open Plan");
register.setFontSize(40);
register.setTextPosition(register.getWidth()/2f, register.getHeight()/2f);[/java]

-
OS is Windows 7 64-Bit, and initialize didn’t do anything regardless, but I did comment it out, so thank!
-
Thanks for the awesome GUI regardless of the issues, I’m enjoying it so much more than nifty, and wish I didn’t spend the last few days messing with it… Oh wells :P.
EDIT:
- After trying to see if anything worked it seems as if [java]setTextPosition[/java] doesn’t do anything. After about font size 25 it starts to shift downwards.
I also tried
[java] register.setPosition(register.getPosition().x-register.getWidth()/2f, register.getPosition().y);
register.setText(“Register”);
register.setFontSize(35);
register.setTextVAlign(BitmapFont.VAlign.Center);
// register.setTextPosition(register.getWidth()/2f, (register.getHeight()/2f) + register.getFontSize());
// register.sizeToContent();[/java]
Setting the text align to “center” it moves the text past the button…
regular align doesn’t do anything, and there is no “horizontal Align” it’s just Align?

- For some reason clicking the title bar of my window allows it to be moved, everything else is off http://i1139.photobucket.com/albums/n551/ThekonradZuse/ToneIssue5_zps654f7c4a.jpg I guess I wasn’t going crazy :P.
