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

Create TextPopup and TextImagePopup #28

Merged
merged 13 commits into from
May 2, 2022
Merged

Conversation

mhawryluk
Copy link
Collaborator

@mhawryluk mhawryluk commented May 1, 2022

Description

Created popups that can be used when implementing various Actions!

TextPopup displays a text, while TextImagePopup displays both a text and an image. Both of them have an "okButton" that currently closes the popup stage, but can be configured to do something else. Popups can also be closed by clicking aside, but that feature could be removed.

Popup constructors can accept paths to assets to configure their graphics, but it's not being used right now. I think that's an issue for another task in this sprint.

How to use the popups

Call an appropriate method from the PopupController, passing what should be displayed, as well as x and y -> position at which the popup center will appear. x and y are most likely the results of Controller.getWindowCenterX and Controller.getWindowCenterY respectively.

Test the new popups

type in 'F' -> open the new TextImagePopup for earned points
type in 'G' -> open the new "hello" TextPopup
pick up items -> another example of a TextImagePopup

Challenge

Take a shot every time I used the word popup here.

Checklist

  • Included code to test these changes -> kinda
  • Updated Jira

Zrzut ekranu 2022-05-1 o 21 22 27

Zrzut ekranu 2022-05-1 o 21 22 17

Copy link
Collaborator

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I left some comments below.

src/main/java/io/rpg/view/popups/TextImagePopup.java Outdated Show resolved Hide resolved
src/main/java/io/rpg/view/popups/TextImagePopup.java Outdated Show resolved Hide resolved
src/main/java/io/rpg/view/popups/TextPopup.java Outdated Show resolved Hide resolved
src/main/java/io/rpg/viewmodel/TextPopupViewModel.java Outdated Show resolved Hide resolved
@mhawryluk mhawryluk merged commit dd3846d into master May 2, 2022
@mhawryluk
Copy link
Collaborator Author

trzeba to gdzieś wkleić (readme?), żeby korzystać z tych grafik: Wood button vector created by upklyak - www.freepik.com

@kkafar
Copy link
Collaborator

kkafar commented May 3, 2022

Sensownie będzie może jakiegoś małego doca zrobić? (resources.md?)

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