Copy link to clipboard
Copied
Hi sorry for my noob question, i need to check if a node is a shape aka graphicNode.. graphic node such as rectangle, ellipse, polygon etc.
I can program it this way..
if (node instanceof Ellipse && node instanceof rectangle && .. )
but wondering if theres something like if (node.isGraphicNode()) or if (node.constructor.superclass) etc.
any help would be great. thank you
Copy link to clipboard
Copied
I assume this is related to plugin development?
Copy link to clipboard
Copied
Yes for plugin development.. perhaps i am in the wrong thread?
If not,
I found that i could find the answer to my question using this:
Object.getPrototypeOf(Object.getPrototypeOf(node)).constructor.name
but did want to know if perhaps there was a better way