We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Implement the sample screen element with pointerup listener code from the docs.
pointerup
class StartButton extends ex.ScreenElement { // ... onInitialize() { this.graphics.add('idle', Resources.StartButtonBackground) // ... this.on('pointerup', () => { alert("I've been clicked") }) // ... } }
An alert should popup on click, especially since the docs state "They automatically capture pointer events".
Nothing happens, since useGraphicsBounds is false since v0.25.2.
Pointers can now be configured to use the collider or the graphics bounds as the target for pointers with the ex.PointerComponent useColliderShape - (default true) uses the collider component geometry for pointer events useGraphicsBounds - (default false) uses the graphics bounds for pointer events
Pointers can now be configured to use the collider or the graphics bounds as the target for pointers with the ex.PointerComponent
useColliderShape - (default true) uses the collider component geometry for pointer events useGraphicsBounds - (default false) uses the graphics bounds for pointer events
class StartButton extends ScreenElement { constructor(config?: ActorArgs) { super(config); this.pointer.useGraphicsBounds = true; this.pointer.useColliderShape = false; }
The text was updated successfully, but these errors were encountered:
@max-vogler Thanks for the issue! Appreciate the workaround you found!
Definitely unexpected, we'll get that fixed asap.
Sorry, something went wrong.
fix: [#2668] ScreenElement pointer capture configured properly
c08feeb
fix: [#2668] ScreenElement pointer capture configured properly (#2669)
661f52f
Closes #2668 Update `ex.ScreenElement` to set a sensible default in it's constructor so it uses graphics bounds to capture pointers
Thanks for the fast and comprehensive fix, @eonarheim!
Successfully merging a pull request may close this issue.
Steps to Reproduce
Implement the sample screen element with
pointerup
listener code from the docs.Expected Result
An alert should popup on click, especially since the docs state "They automatically capture pointer events".
Actual Result
Nothing happens, since useGraphicsBounds is false since v0.25.2.
Environment
Current Workaround
The text was updated successfully, but these errors were encountered: