Hi Bohdan,
I've been building my components by extending the AbstractVisionShape
class, which itself is an extension of AbstractVisionComponent
and it also implements the Bounds2DComponent
interface. Maybe that's the way to go for you as well, instead of trying to implement Bounds2DComponent
yourself.
As to your question here:
I add the boundingRect
property just like any other property:
addProp("boundingRect",
"Bounds",
"Bounding rectangle of the component.",
CAT_POSITION,
HIDDEN_MASK);
I use the HIDDEN_MASK, because there is no need for this property to be visible. It is only necessary for serialization.