Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Selecting entities #343290
10/05/10 05:59
10/05/10 05:59
Joined: Oct 2010
Posts: 8
Malaysia
N
Nish Offline OP
Newbie
Nish  Offline OP
Newbie
N

Joined: Oct 2010
Posts: 8
Malaysia
Hi,
how can i make the entity selected when i click it. Anyone can help me!...

Re: Selecting entities [Re: Nish] #343291
10/05/10 06:28
10/05/10 06:28
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271

Re: Selecting entities [Re: Saturnus] #343425
10/06/10 10:08
10/06/10 10:08
Joined: Oct 2010
Posts: 8
Malaysia
N
Nish Offline OP
Newbie
Nish  Offline OP
Newbie
N

Joined: Oct 2010
Posts: 8
Malaysia
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.

Re: Selecting entities [Re: Nish] #343427
10/06/10 11:00
10/06/10 11:00
Joined: Mar 2006
Posts: 1,993
Karlsruhe
PadMalcom Offline
Serious User
PadMalcom  Offline
Serious User

Joined: Mar 2006
Posts: 1,993
Karlsruhe
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.

Last edited by PadMalcom; 10/06/10 11:01.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1