This is a weird problem I’m having. On most resolutions, this problem goes away, but resolutions like full-screen Have this issue.
I have two buttons on a window. When I click them, one quits, the other takes me back to the home screen.
The issue is, when in full screen resolution, the buttons can’t be clicked. Or, rather, they can’t be clicked because the hover and pulse effects are even being picked up. However, after moving around the window for like, 2 minutes, sometimes, a button becomes clickable. But only if the window is dragged to certain parts of the screen.
Here’s what I’m talking about: [video]http://youtu.be/pC67VFez5HY[/video]
Whenever the window is still, I’m actually hovering over the button and demonstrating that it’s not clickable. Then, all of a sudden, I found a spot where the hover effect is kicking in, and so it is clickable.
[java]quit_button = new ButtonAdapter(screen,"quit", new Vector2f(0, 0), new Vector2f(screen.getWidth()/10, screen.getHeight()/15)) {
@Override
public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
app.getInputManager().removeListener(actionListener);
quit = true;
app.stop();
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
};
quit_button.setText("Quit");
quit_button.setPosition(20,20);
quit_button.setFont("Interface/Fonts/HumboldtFraktur.fnt");
quit_button.setFontSize(fontSize);
quit_button.setTextPosition(0f,0);
quit_button.setTextAlign(BitmapFont.Align.Center);
//quit_button.setTextVAlign(BitmapFont.VAlign.Top);
window.addChild(quit_button);
Label unpause = new Label(screen,"unpause",new Vector2f(0,0),new Vector2f(200,50));
unpause.setPosition(20,window.getHeight()-unpause.getHeight()-5);
unpause.setText("Hit 'P' to play");
unpause.setFontSize(fontSize);
unpause.setFont("Interface/Fonts/KnightsQuest.fnt");
window.addChild(unpause);
main_button = new ButtonAdapter(screen,"main", new Vector2f(0, 0), new Vector2f(screen.getWidth()/10, screen.getHeight()/15)) {
@Override
public void onButtonMouseLeftUp(MouseButtonEvent evt, boolean toggled) {
home = true;
app.getInputManager().removeListener(actionListener);
app.getStateManager().detach(app.getStateManager().getState(PauseState.class));
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
};
main_button.setText("Home");
main_button.setPosition(window.getWidth()-main_button.getWidth()-20,20);
main_button.setFont("Interface/Fonts/HumboldtFraktur.fnt");
main_button.setFontSize(fontSize);
main_button.setTextPosition(0f,0);
main_button.setTextAlign(BitmapFont.Align.Center);
//quit_button.setTextVAlign(BitmapFont.VAlign.Top);
window.addChild(main_button);[/java]