slot1 is the panel?
if yes.. try this (not tested)
but I'm not sure is this what U want to do
Code:
entity* cofee_ent;
define holding,skill1;
in some function
{
ent_create("kaffeebecher.mdl",nullvector,item_kaffee);
}
function cofee_event
{
if(event_type == event_click)
{
my.scale_x = 2;
my.holding =1;
}
else
{
my.holding =0;
my.scale_x = 1;
if(event_type == event_touch)
{
my.pan += 5* time_step;
}
if(event_type == event_release)
{
my.pan += 0;
}
}
}
function item_kaffee
{
cofee_ent = me;
my.enable_touch = on;
my.enable_release = on;
my.ENABLE_click = ON;
my.event = cofee_event;
while(me)
{
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
if(my.holding == 1) && (mouse_left ==1)
{
temp.x = mouse_pos.x; temp.y = mouse_pos.y temp.z = 50; //cofee at mouse position
}
if(my.holding == 0)
{
temp.x = slot1.x; temp.y = slot2.y temp.z = 50; //cofee at slot position
}
vec_for_screen(temp,camera);
vec_set(my.x, temp); //cofee will be always 50 quants front of camera
wait(1);
}
}