Selecting entities

Posted By: Nish

Selecting entities - 10/05/10 05:59

Hi,
how can i make the entity selected when i click it. Anyone can help me!...
Posted By: Saturnus

Re: Selecting entities - 10/05/10 06:28

This should help:
http://www.conitec.net/beta/aevent_click.htm
Posted By: Nish

Re: Selecting entities - 10/06/10 10:08

hi,
thanks for the help. Actually i want to make the object selected in 3D environment.
so i will provide the button, when the user click on the button they can scale, rotate and move the selected object in the 3D environment.

im having the problem to do the selection of the object, to scale, move and rotate.

tq.
Posted By: PadMalcom

Re: Selecting entities - 10/06/10 11:00

Code:
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.
© 2023 lite-C Forums