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

Scene constructor documentation is confusing/inconsistent #1363

Closed
eonarheim opened this issue Dec 26, 2019 · 0 comments
Closed

Scene constructor documentation is confusing/inconsistent #1363

eonarheim opened this issue Dec 26, 2019 · 0 comments
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/

Comments

@eonarheim
Copy link
Member

Steps to Reproduce

https://codesandbox.io/s/excaliburjs-reproduction-01-pezj9

import * as ex from 'excalibur'

const game = new ex.Engine({
  width: 800,
  height: 600,
  displayMode: ex.DisplayMode.FullScreen,
  pointerScope: ex.Input.PointerScope.Document,
})

const Scene1 = new ex.Scene()
const label = new ex.Label('Hello', 10, 10, '48px Arial')

Scene1.add(label)

game.addScene('Scene1', Scene1)
game.goToScene('Scene1')
game.start()

Expected Result

The typings for new ex.Scene indicate that it requires an Engine object to be passed in, yet it actually does not. Why is this? I see that the argument is labeled in the Typescript idiom which indicates an unused variable (leading underscore).

Actual Result

Engine is not actually required

Environment

  • operating system: n/a
  • Excalibur versions: master

Current Workaround

Use ex.Scene with or without passing an Engine argument

Suggested fix

Either update the documentation to disambiguate proper usage, or correct the typing on ex.Scene

@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Dec 26, 2019
@eonarheim eonarheim added Hacktoberfest Issues marked for the community Hacktoberfest event https://hacktoberfest.digitalocean.com/ and removed potential-hacktoberfest labels Oct 1, 2020
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
Development

No branches or pull requests

1 participant