I have the following piece of Konva code and I am trying to update the text attribute
var lifePoint = new Konva.Text({
x: 50,
y: 50,
id: 'P1',
text: 'Player Lifepoint: 100',
fontSize: 30
});
After reading the documentation I tried:
// find and change text
const test = layer.find('#P1')[0];
test.setAttr('text', 'changed');
Could anybody possibly tell me what I am doind wrong?