npm.io
0.4.3 • Published 2 years ago

twitch-chat-emotes-threejs

Licence
ISC
Version
0.4.3
Deps
1
Size
14 kB
Vulns
0
Weekly
0
Stars
2

twitch-chat-emotes-threejs

A Three.JS specific variant of the twitch-chat-emotes package.

Example repository

import TwitchChat from 'twitch-chat-emotes-threejs';

const ChatInstance = new TwitchChat({
	// If using planes, consider using MeshBasicMaterial instead of SpriteMaterial
	materialType: THREE.SpriteMaterial,

	// Passed to material options
	materialOptions: {
		transparent: true,
	},

	materialHook: material => console.log, // receives unique emote materials on creation
	textureHook: texture => console.log, // receives unique emote textures on creation

	channels,
	maximumEmoteLimit: 3,
});

ChatInstance.listen((emotes) => { //receives an array of "emote" objects, THREE.js material is within emotes[i].material
	console.log(emotes);
});
``