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

change: examples common code #35

Closed
eviltik opened this issue Mar 21, 2022 · 4 comments
Closed

change: examples common code #35

eviltik opened this issue Mar 21, 2022 · 4 comments
Assignees
Labels
discussion enhancement New feature or request
Milestone

Comments

@eviltik
Copy link
Collaborator

eviltik commented Mar 21, 2022

Plenty of code in examples can be stored in one js class witch can be extended :

App:

  • constructor
  • initScene
  • setupXR
  • resize
  • render

Final code example:

import { Environnement } from '../Environnement.js';
import { CanvasUI } from '../../jsm/CanvasUI.js';

class App extends Environnement {
    constructor() {
        super();
    }

    createUI() {
        ...
    }

}

The Environnement class will have little methods like setupRenderer, setupCamera, so we can override methods in the main class easily.

@NikLever will you accept this change ?

@eviltik eviltik added enhancement New feature or request discussion labels Mar 21, 2022
@eviltik eviltik added this to the short term milestone Mar 21, 2022
@eviltik
Copy link
Collaborator Author

eviltik commented Mar 21, 2022

related to #33

@eviltik eviltik self-assigned this Mar 21, 2022
@eviltik
Copy link
Collaborator Author

eviltik commented Mar 26, 2022

is it ok for you @NikLever ? ty

@NikLever
Copy link
Owner

I don't want to leave users feeling they need to use a helper class with CanvasUI. So on balance I don't like the idea. But you could convince me. BTW Environnement is spelt Environment in English. Probably best to use the English spelling.

@eviltik
Copy link
Collaborator Author

eviltik commented Mar 26, 2022

I don't want to leave users feeling they need to use a helper class with CanvasUI.

I can understand ! It's more easy for users.

Wont fix.

@eviltik eviltik closed this as completed Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants