Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narazaka/verseengine-modules
modules for verseengine/verse-three
https://github.com/narazaka/verseengine-modules
metaverse verseengine
Last synced: about 2 months ago
JSON representation
modules for verseengine/verse-three
- Host: GitHub
- URL: https://github.com/narazaka/verseengine-modules
- Owner: Narazaka
- License: zlib
- Created: 2023-07-12T14:33:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-20T02:24:13.000Z (12 months ago)
- Last Synced: 2024-11-26T13:14:58.834Z (about 2 months ago)
- Topics: metaverse, verseengine
- Language: TypeScript
- Homepage: https://narazaka.github.io/verseengine-modules/
- Size: 243 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# verseengine-modules
modules for verseengine/verse-three
typesafe initialize!
## Install
```sh
npm i verseengine-modules
```## Resources
- **[API Document](https://narazaka.github.io/verseengine-modules/)**
- [MyVerse](https://myverse.narazaka.net) is using this library.## Usage
```ts
import * as VerseThree from "@verseengine/verse-three";
import { initializeVerseModule } from "verseengine-modules";
import nameplate from "verseengine-modules/nameplate";
import joinSound from "verseengine-modules/joinSound";
import micStatus from "verseengine-modules/micStatus";
import playerSessionId from "verseengine-modules/playerSessionId";
import enableXrController from "verseengine-modules/enableXrController";
import enableMoveController from "verseengine-modules/enableMoveController";
import nameLog from "verseengine-modules/nameLog";
import adjustNameplatePosition from "verseengine-modules/adjustNameplatePosition";
import chat from "verseengine-modules/chat";
import { setNoname } from "verseengine-modules/util/playerName";const domRoot = document.getElementById("app");
const envAdapter = new VerseThree.DefaultEnvAdapter(...);
const verseStartResult = await VerseThree.start(...);
ticks.push(verseStartResult.tick);setNoname("");
const verseModule = initializeVerseModule({
verseStartResult,
envAdapter,
domRoot,
});
verseModule
.initialize(micStatus, { textureUrl: "./asset/ui/mute.png" })
.initialize(playerSessionId)
.initialize(nameplate, {})
.initialize(adjustNameplatePosition)
.initialize(joinSound, { audioSrc: "./asset/ui/join.m4a" })
.initialize(enableXrController)
.initialize(enableMoveController)
.initialize(nameLog, {})
.initialize(chat, {
balloon: true,
notifySound: { audioSrc: "./asset/ui/chat.m4a" },
});
```see [examples/src/main.ts](https://github.com/Narazaka/verseengine-modules/blob/master/examples/src/main.ts)
## Make your own module
```ts
// myModule.ts
export default ({
addTextDataChangedListener,
}: VerseModuleBase<{}, PlayerNameData>) => ({
initialize(options?: { prefix?: string }) {
addTextDataChangedListener((_, data) => {
console.log(prefix, data.name);
});
},
});// main.ts etc.
import myModule from "./myModule";verseModule
.initialize(playerSessionId)
.initialize(nameplate, {})
.initialize(myModule, { prefix: "name =" });
```## License
[Zlib license](LICENSE)