Tag Info

New answers tagged

2

Menno Gouw's answer is correct and is probably the way to go in most cases, but just in case someone runs into my problem where that solution might distort the positioning of other actors I thought I'd post how I solved it. First Create an "invisible" button: ImageButtonStyle style = new ImageButtonStyle(); style.up = null; style.down = null; ...


3

Try this: @Override public void keyboardFocusChanged(FocusEvent event, Actor actor, boolean focused) { super.keyboardFocusChanged(event, actor, focused); if (!focused) setOnscreenKeyboardVisible(false); } Otherwise you could go for a better work around. You place a big clickable transparent actor behind everything. When you click anywhere ...


0

I'm using SDL-2 also. Your code, at a basic reading, looks all correct to me. To help debug it, you could put a switch or printf right in the main loop, like while(GameState == RUNNING) { while(SDL_PollEvent(&Event)) { printTheEventIfItsKeyUpOrKeyDown(&Event); // as needed Handle(&Event); } A modifier key down also ...


1

You could check to see if the key was pressed in the previous frame. Consider doing something like this: bool DownPressed; bool UpPressed; .... if (KeyBinding.downDown) { if (!DownPressed) { DownPressed = true; nextEntry(); } } else { DownPressed = false; } if (KeyBinding.upDown) { if (!UpPressed) { ...



Top 50 recent answers are included