Wonderland Engine integration for the canvas-ui Typescript UI library.
Documentation is available on Github pages.
Documentation for canvas-ui is available in the canvas-ui repository.
npm install --save-dev @rafern/canvas-ui
npm install --save-dev @rafern/canvas-ui-wl
require
@rafern/canvas-ui
and @rafern/canvas-ui-wl
in your bundle scriptIf you are using the stable release versions, then simply run npm run build
.
Wonderland Engine nightlies don't have official type definition files. To work
around this, nightly type definition files can be generated from the
wonderland.min.js
sourcemap file. This isn't perfect (ctrl+F FIXME), but it
works for now and only needs to be done once (or when the API changes).
wonderland.min.js
file from a Wonderland Editor project's deploy
folder and put it inside types/wonderland
.npm run gen_wle_types
.@wonderlandengine/api
package.tsconfig.json
file:{
// ...
"compilerOptions": {
// ...
"paths": {
"@wonderlandengine/api": ["./types/wonderland/wonderland.d.ts"]
}
// ...
}
// ...
}
Contributions with generated wonderland.d.ts
or any nightly Wonderland
Engine file will be rejected. Nightlies are not meant to be redistributed.
Example usage can be found in example-components.
A default virtual keyboard component, virtual-keyboard-ui-root
, is supplied.
The implementation can be found in
src/components/virtual-keyboard-ui-root.js.
A component which disables a component of 2 given objects if the keyboard and/or
mouse are in use in a UI root is also provided. The component is named
canvas-ui-input-guard
.
Special thanks to Playko (website, github) where this project started and is currently being developed at, and to the Wonderland Engine developers (website).
This project is licensed under the MIT license (see the LICENSE file)
This project uses the following open-source projects:
Generated using TypeDoc