Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in navigating up and down #41

Open
MonstrousSoftware opened this issue Dec 21, 2023 · 0 comments
Open

bug in navigating up and down #41

MonstrousSoftware opened this issue Dec 21, 2023 · 0 comments

Comments

@MonstrousSoftware
Copy link

I think I found a bug in ControllerMenuStage for the case where I want to use UP and DOWN keys to navigate buttons placed above each other for a jam game. And I found it was skipping some buttons on the way down, and other buttons on the way up. The buttons have different width.

In line 484 it should read 'north' because 'south' is already covered in the previous line.

                        new Vector2(direction == MoveFocusDirection.west ? currentActor.getWidth() :
                                direction == MoveFocusDirection.east ? 0 : currentActor.getWidth() / 2,
                                direction == MoveFocusDirection.south ? currentActor.getHeight() :
                                        direction == MoveFocusDirection.south ? 0 : currentActor.getHeight() / 2));

In line 519 the horizontal distance is emphasized if you are moving north or south. This should probably read east or west.

        if (direction == MoveFocusDirection.south || direction == MoveFocusDirection.north)
            horizontalDist = horizontalDist * directionEmphFactor;
        else
            verticalDist = verticalDist * directionEmphFactor;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant