whs.js
whs.js copied to clipboard
Core API
API
This issue exists for v2.x.x API discussion. Please, add your API suggestions in comments below
App
This class is used to prepare a world scene, setup physics, camera, renderer and all other things that you usually do before making meshes.
components
Component
is a main class which is commonly used in core parts of WhitestormJS framework. Component is used in MeshComponent and almost all known classes of framework.
modules
Modules provide easy integration with components. They can make a lot of complex things much simpler to other developers (such as adding 3D physics).
- Migrating to WhitestormJS v2 beta. Module system
- WhitestormJS v2 Beta: New Ecosystem
- Documentation: Module
Version:
- [x] v2.x.x
- [ ] v1.x.x
Issue type:
- [ ] Bug
- [ ] Proposal/Enhancement
- [ ] Question
- [x] Discussion
Tested on:
Desktop
- [ ] Chrome
- [ ] Chrome Canary
- [ ] Chrome dev-channel
- [ ] Firefox
- [ ] Opera
- [ ] Microsoft IE
- [ ] Microsoft Edge
Android
- [ ] Chrome
- [ ] Firefox
- [ ] Opera
IOS
- [ ] Chrome
- [ ] Firefox
- [ ] Opera
/ping @thejmazz
One suggestion for the module API: swap this
and self
in integrate(self)
. Currently:
class Module {
integrate(self) {
// `this` is the app instance
// `self` is the module instance
}
}
let app = new WHS.App([new Module()]);
A new API would look like:
class Module {
version = 2; // Tell WHS to use a new module API. This way existing modules don't break.
integrate(component) {
// `this` is the module instance
// `component` is the app instance
}
}