Код: Выделить всё
bg // Graphic for input detection
.rect(0, 0, app.width, app.height)
.fill('white')
.on('pointermove', e => {
const mouse = mousePos(e, app);
stroke
.clear()
.moveTo(last.x, last.y)
.lineTo(mouse.x, mouse.y)
.stroke({
color: 'red',
width: 4,
cap: 'round'
});
const strokeTexture = app.renderer.generateTexture(stroke);
brush.texture = strokeTexture;
brush.position.set(last.x, last.y);
const temp = rt1;
rt1 = rt2;
rt2 = temp;
canvas.texture = rt1;
app.renderer.render({
container: app.stage,
target: rt2,
clear: false
});
last = mouse;
Я не уверен, что вызывает это.>
Подробнее здесь: https://stackoverflow.com/questions/797 ... ed-strokes
Мобильная версия