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

class Pointer does not have class Pointers events #1345

Closed
lordnox opened this issue Dec 1, 2019 · 1 comment · Fixed by #1347
Closed

class Pointer does not have class Pointers events #1345

lordnox opened this issue Dec 1, 2019 · 1 comment · Fixed by #1347
Assignees
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior

Comments

@lordnox
Copy link

lordnox commented Dec 1, 2019

Steps to Reproduce

game.input.pointers.primary.on('down', event => {
  // expected "event" to be Input.PointerEvent
  const evt = event as Input.PointerEvent // this cast does work
  evt.pos // exists in TypeScript
  event.pos // does not but is expected
})
game.input.pointers.on('down', event => {
  // the default pointers do correctly cast the type to Input.PointerEvent
  event.pos // does exist
})

Expected Result

I did expect that a specific Pointer does have the PointerEvents associated

Actual Result

PointerEvents are not correctly Typed for class "Pointer"

Current Workaround

See code above

@eonarheim
Copy link
Member

@lordnox Thanks for the find! This was an oversight during a recent refactoring. We'll get this resolved asap.

@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Dec 1, 2019
@eonarheim eonarheim self-assigned this Dec 1, 2019
@eonarheim eonarheim added this to the 0.24.0 Release milestone Dec 1, 2019
eonarheim added a commit that referenced this issue Dec 3, 2019
Closes #1345

## Changes:

- Add's strong type signatures to the `Pointer` type for `on(...)`, `once(...)`, and `off(..)` handlers
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