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

Play button is not cleaned up on stop #1431

Closed
kamranayub opened this issue Feb 26, 2020 · 2 comments · Fixed by #2066
Closed

Play button is not cleaned up on stop #1431

kamranayub opened this issue Feb 26, 2020 · 2 comments · Fixed by #2066
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/

Comments

@kamranayub
Copy link
Member

kamranayub commented Feb 26, 2020

Steps to Reproduce

  1. Create a game
  2. Start the game
  3. Stop the game

Expected Result

Play button should disappear/be cleaned up

Actual Result

Play button sticks around

Environment

  • browsers and versions: Chrome 79
  • operating system: Mac OS
  • Excalibur versions: 0.23.0
  • (anything else that may be relevant)

Current Workaround

Target HTML element manually and delete from DOM

@kamranayub kamranayub added the bug This issue describes undesirable, incorrect, or unexpected behavior label Feb 26, 2020
eonarheim added a commit that referenced this issue May 23, 2020
…p html (#1507)

Closes #1417
Closes #1431

## Changes:

- Adds an id to the play button root element `#excalibur-play-root`
- Allows modification of all loader positioned elements
   - Logo
   - Play button
   - Loading bar
- Additionally allows the loading bar color to be set
@kamranayub
Copy link
Member Author

This is still an issue, if you don't click the play button. I think engine needs to call dispose whenever stop is called 😄

@kamranayub kamranayub reopened this Sep 11, 2021
@kamranayub kamranayub added the Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/ label Sep 11, 2021
@kamranayub
Copy link
Member Author

Workaround:

function cleanUpPlayButtons() {
  const playButtons = document.querySelectorAll("#excalibur-play-root");

  playButtons.forEach((playButton) => {
    if (playButton.parentNode) {
      playButton.parentNode.removeChild(playButton);
    }
  });
}

catrielmuller added a commit to catrielmuller/Excalibur that referenced this issue Oct 23, 2021
catrielmuller added a commit to catrielmuller/Excalibur that referenced this issue Oct 23, 2021
eonarheim pushed a commit that referenced this issue Oct 25, 2021
Co-authored-by: Erik Onarheim <erik.onarheim@gmail.com>


Closes #1431

## Changes:

- `withEngine` utils support an aditional options parameter to override the Engine default options.
- Story to show a play / pause implementation. 
- Dispatch the `hidePlayButton` on the Button Event to prevent that keep on the screen on some situations [#1431].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/
Projects
None yet
1 participant