Page 1 of 1

How to get the id of an entity with a clik and / or with the pointer overlap

Posted: Fri Dec 06, 2019 9:48 am
by pietro_72_
Hi
How can I get the id of a point entity when I click on it with the mouse and / or when I go over it with the mouse pointer

Re: How to get the id of an entity with a clik and / or with the pointer overlap

Posted: Fri Dec 06, 2019 2:37 pm
by andrew
If you have the entity, you can use:

Code: Select all

var id = entity->getId();
If you don't have the entity, you can get the one closest to the mouse cursor with:

Code: Select all

this.getEntityId(event, false, true);
Where event is an RInputEvent (mouse move event or mouse click event).

Defined in:

Code: Select all

EAction.prototype.getEntityId = function(event, preview, selectable)

event RInputEvent
preview for previewing purposes
selectable Only return selectable (editable) entities

Re: How to get the id of an entity with a clik and / or with the pointer overlap

Posted: Fri Dec 06, 2019 3:25 pm
by pietro_72_
Thanks Andrew

Re: How to get the id of an entity with a clik and / or with the pointer overlap

Posted: Fri Dec 13, 2019 8:29 am
by pietro_72_
I succeeded by also taking cues from Cross.js