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 Example extends lng.Application {
static _template() {
return {
flex: {direction: 'column'}, x: 15, y: 15,
Text1: {
text: { text: 'No letter spacing.', fontSize: 24}
},
Text2: {
text: { text: 'Letter spacing of 10.', letterSpacing: 10, fontSize: 24}
},
Text3: {
text: { text: 'Negative letter spacing.', letterSpacing: -2, fontSize: 24}
}
}
}
}
const options = {
stage: {
w: 900,
h: 900,
clearColor: 0xFF000000,
canvas2d: false,
useImageWorker: false
},
debug: true
}
const app = new Example(options);
document.body.appendChild(app.stage.getCanvas());