JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/wpe-lightning@1.10.0/dist/lightning.js"></script>
<div id="app"></div>
JavaScript
class RoundedRectExample extends lng.Application {
static _template() {
return {
Base: {
rtt: true,
w: 300,
h: 300,
Inner: {
shader: {
type: lng.shaders.RoundedRectangle,
radius: 40,
fillColor: 0xff77ffff,
stroke: 10,
strokeColor: 0xffff4455,
},
src: "https://image.shutterstock.com/image-vector/example-signlabel-features-speech-bubble-260nw-1223219848.jpg",
},
}
}
}
}
const options = {
stage: {
w: 900,
h: 900,
clearColor: 0xFF000000,
canvas2d: false,
useImageWorker: false
},
debug: true
}
const app = new RoundedRectExample(options);
document.body.appendChild(app.stage.getCanvas());