Skip to content

Up/Down menu navigation #31

Description

@MonstrousSoftware

Redirected from libgdx/gdx-controllers issue list:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions