Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
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
2 registered members (3run, AndrewAMD), 667 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
view entities clickable #380215
08/14/11 17:36
08/14/11 17:36
Joined: Aug 2011
Posts: 3
O
OldCode Offline OP
Guest
OldCode  Offline OP
Guest
O

Joined: Aug 2011
Posts: 3
ok so i used to game program years back and now im back into it, but really rusty lol.

i have a question: how can you make view entities (ones created by ent_createlayer) respond to mouse clicks?

heres some code:

you=ent_createlayer("grass.mdl",0,1);
you.x=100;
you.y=0;
you.z=0;
you.enable_click=on;
you.event=item_move;


and the item_move instruction,created for debugging:

function item_move()
{
my.pan+=10;
}

this will work if i just use ent_create("grass.mdl",nullvector,null) instead of ent_createlayer but i need the entity to on the screen as an inventory item.

Re: view entities clickable [Re: OldCode] #380238
08/14/11 23:58
08/14/11 23:58
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Did you try ent_mouse?

Re: view entities clickable [Re: Pappenheimer] #380245
08/15/11 06:29
08/15/11 06:29
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You mean mouse_ent wink
And this works only with level entities

Re: view entities clickable [Re: Widi] #380348
08/16/11 03:25
08/16/11 03:25
Joined: Aug 2011
Posts: 3
O
OldCode Offline OP
Guest
OldCode  Offline OP
Guest
O

Joined: Aug 2011
Posts: 3
so how can is there a function for clicking view entities (ie dragging and dropping an entity from an inventory panel)?

Re: view entities clickable [Re: OldCode] #380350
08/16/11 08:01
08/16/11 08:01
Joined: Feb 2010
Posts: 320
TANA/Madagascar
3dgs_snake Offline
Senior Member
3dgs_snake  Offline
Senior Member

Joined: Feb 2010
Posts: 320
TANA/Madagascar
Hi,

Why not using an animated sprite for the inventory item?

Best regards.

Re: view entities clickable [Re: 3dgs_snake] #380383
08/16/11 16:17
08/16/11 16:17
Joined: Aug 2011
Posts: 3
O
OldCode Offline OP
Guest
OldCode  Offline OP
Guest
O

Joined: Aug 2011
Posts: 3
animated sprite? I used a view entity so that it'll float over the inventory panel. I ended up hacking together some code where it converts the view entity's position vector to a screen vector (via rel_to_screen) then checking to see if the LMB is pressed and if the cursor is within 20 quants of the entitys screen postition. if it is, attach the view entity to the mouse. else let the view entity snap back to its inventory position.


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