ENTITY* selectedEntity = NULL;
function click_event()
{
if (event_type == EVENT_CLICK)
{
selectedEntity = me;
}
}
action myClickableEntity()
{
my.emask |= ENABLE_CLICK;
my.event = mouse_event;
}
function changePosX() {
if (selectedEntity != NULL) {
selectedEntity.x +=1;
}
}
When you click the entity, the selectedEntity pointer will point on the entity you clicked. Then you can scale, rotate or do whatever with the entity by using buttons on a panel.