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

Pandroid: add option to change screen gamepad, buttons position. #359

Merged

Conversation

GabrielBRDeveloper
Copy link
Contributor

Changelog

  • Now is possible create multiples screen gampead layout.
  • Now is possible change screen gamepad buttons position and visibility. You can set a layout for portrait and landscape mode, only rotate screen or click in rotate screen button on editor.

Screnshots

screenshot-2024-01-01_21 54 24 447

screenshot-2024-01-01_21 54 32 839

screenshot-2024-01-01_21 54 04 567


public String formatName(String name) {
name = String.valueOf(name);
while (name.startsWith(" ")) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't the 2 loops just be removed by using name.trim()

}

public void drawSelected(Canvas canvas, Paint paint) {
int[] mePosition = new int[2];
Copy link
Owner

@wheremyfoodat wheremyfoodat Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming is terrible, mainly cause "me" and the like aren't descriptive at all (and code typically uses "this" instead of "me" the rare times a name like this is actually desired)

int width = selectedView.getLayoutParams().width;
int height = selectedView.getLayoutParams().height;

int x = viewPosition[0] - mePosition[0];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are also dx and dy

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually no keep them x/y

@GabrielBRDeveloper
Copy link
Contributor Author

Done
(1efb149)

@wheremyfoodat wheremyfoodat merged commit c849af4 into wheremyfoodat:master Jan 3, 2024
14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants