2

I'm creating a set of circles and would like to iterate through them and highlight based on an identifier of some kind.

It would great if I could just set circle.id = 1, circle.id = 2, ...

gmcerveny
  • 191
  • 1
  • 17

1 Answers1

1
// create circle
var circle = new Konva.Circle({
  radius: 40,
  fill: 'red',
  stroke: 'black',
  strokeWidth: 5
});

// set id
circle.id('foo');

// get id
var name = circle.id();

Note: id = type String, inherited from Konva.Node#id

Link: https://konvajs.org/api/Konva.Circle.html#id__anchor

iokevins
  • 1,427
  • 2
  • 19
  • 29