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 position cannot be set with CSS #1417

Closed
DaVince opened this issue Feb 9, 2020 · 0 comments · Fixed by #1507
Closed

Play button position cannot be set with CSS #1417

DaVince opened this issue Feb 9, 2020 · 0 comments · Fixed by #1507
Assignees
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior

Comments

@DaVince
Copy link
Contributor

DaVince commented Feb 9, 2020

Steps to Reproduce

Override the load button CSS by giving it the following properties:

position: relative;
top: 25px;

Expected Result

The button should be positioned at 25 pixels from the top of the game canvas.

Actual Result

The button is positioned 25 pixels down from the _playButtonRootElement, which is given a specific position and size, so the positioning happens relative to this element and the CSS overflow causes part of the button to be hidden.

image

(Note that I've switched to using a loader with a customized style to just get around this problem, without success, because the root element cannot be affected. Also, the off-center positioning of the button is caused by me using DisplayMode.Fixed and then changing the DOM canvas size to be 2x or 3x the normal size for perfect pixel scaling.)

Environment

  • Chromium79.0.3945.130
  • Ubuntu 19.10
  • Excalibur 0.23.0

Current Workaround

Using a custom loader that doesn't have a button would get around this entirely.

Suggestions for solutions

I can think of a few ways and levels to fix this on, but the most obvious one would be in the Loader class. The Loader class already provides customization options like changing the logo size and loader background. It would make sense to have options that allow you to set the positions of the various elements here.

loader.autoPosition = false; // When true, automatically position using the current method
loader.playButtonPosition = new Vector(20, 20);
loader.logoPosition = new Vector(200, 20);
@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Apr 26, 2020
@eonarheim eonarheim self-assigned this Apr 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
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants