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

Enhanced the UI and added Keyboard Support for options #14

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

jriyyya
Copy link

@jriyyya jriyyya commented Aug 13, 2023

No description provided.

jriyyya and others added 5 commits August 8, 2023 15:05
- shifted both by 70px (measured via photoshop)

- they were shifted such that they appear on the ground rather than
floating on top of it
- added a generic class which acts as the button for
  the options to selct from

- it has rounded corners and is similar to the button
  class in objects
- the self.buttons array now contains the new option_buttons

- the drawing method has been updated for self.buttons

- A,B,C,D are now added to each option
- now an option can be selected using the keyboard keys
  A, B, C, D and 1, 2, 3 ,4
@jriyyya
Copy link
Author

jriyyya commented Sep 12, 2023

Even after updating the sugargmae, Keyboard keys still seems to not work on some version of pygame, Tested with pygame 2.4.0 , python 3.7.3

Issue:
Key events where not detectable

Fix:
Add `self._pygamecanvas.grab_focus()` to math_hurdlerActivity.py
@Dimi20cen
Copy link

Made a pull request to your patch-ui branch to fix issue.

@jriyyya jriyyya marked this pull request as ready for review September 17, 2023 13:50
@jriyyya
Copy link
Author

jriyyya commented Sep 17, 2023

@chimosky @sourabhaa You can review this now

math_hurdler.py Outdated Show resolved Hide resolved
option_button.py Show resolved Hide resolved
option_button.py Outdated Show resolved Hide resolved
math_hurdler.py Outdated Show resolved Hide resolved
math_hurdler.py Outdated Show resolved Hide resolved
@chimosky
Copy link
Member

Reviewed ddcb7cf, not tested.

@jriyyya
Copy link
Author

jriyyya commented Sep 17, 2023

@chimosky Thanks for the review, made the requested changes.

@jriyyya
Copy link
Author

jriyyya commented Sep 29, 2023

Reminder for testing 👀

@Dimi20cen
Copy link

Reviewed and tested with python3.7.3, pygame 2.4.

math_hurdler.py Outdated Show resolved Hide resolved
math_hurdler.py Outdated

self.buttons[self.question.answer_index].set_color(
Color.GREEN, False)

Color.GREEN)

while self.running:
# Processing Gtk Events
Copy link
Member

Choose a reason for hiding this comment

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

I know this wasn't your change but could you please remove redundant comments like this?

Copy link
Author

Choose a reason for hiding this comment

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

Yes yes, sure

@chimosky
Copy link
Member

chimosky commented Oct 2, 2023

Tested ba76b93, the answers seem to collide and aren't visible.
Screenshot from 2023-10-02 19-00-40

@Dimi20cen
Copy link

Dimi20cen commented Oct 2, 2023

Is the issue reproducible with a specific screen size?

@jriyyya
Copy link
Author

jriyyya commented Oct 4, 2023

I see, Will look into it

@chimosky
Copy link
Member

chimosky commented Oct 9, 2023

Is the issue reproducible with a specific screen size?

Tested on a 1024x768 screen.

@Dimi20cen
Copy link

Tested ba76b93, the answers seem to collide and aren't visible.

The text inside the Hurdle's window also cuts of in smaller resolutions
Screenshot from 2023-10-12 15-08-10

@Dimi20cen
Copy link

Making the following font sizes adapt to screen size would probably fix the issue.

        self.font = pygame.font.SysFont('monospace', 36)
        self.lg_font = pygame.font.SysFont('monospace', 20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants