⚙️ A Webpack Loader for Reaper files.
⚠️ This loader needs you to have Reaper installed.
npm install @theatrejs/loader-reaper --save-dev
{
'module': {
'rules': [
...
{
'test': /\.rpp$/,
'use': [
{
'loader': '@theatrejs/loader-reaper',
'options': {
'reaper': '<path-to-reaper>' // The path to the Reaper executable.
}
}
]
}
...
]
}
}
⚠️ This example does not include the preloading of assets.
import {Actor, Sound} from '@theatrejs/theatrejs';
import soundBreathe from './breathe.rpp';
class Hero extends Actor {
onCreate() {
this.addSound(
new Sound({
$audio: soundBreathe
})
);
}
}
import {FACTORIES, Sound} from '@theatrejs/theatrejs';
import soundBreathe from './breathe.rpp';
class Hero extends FACTORIES.ActorWithPreloadables([FACTORIES.PreloadableSound(soundBreathe)]) {
onCreate() {
this.addSound(
new Sound({
$audio: soundBreathe
})
);
}
}