Quote:
Code:
text contact_text
{
font = standard_font;
layer = 10;
pos_x = 350;
pos_y = 100;
size_y = 70;
offset_y = 0;
flags = center_x, narrow, visible;
}
string str1 = "The mouse is touching the tree. \n Testing the text now. \n testing the line breaks also! loading.....";
function mouse_test()
{
temp.x = MOUSE_POS.x;
temp.y = MOUSE_POS.y;
temp.z = MOUSE_POS.Z;
vec_for_screen(temp, camera);
if((temp.x == tree.x) && (temp.y == tree.y) && (temp.z == tree.z))
{
contact_text.string = str1;
}
wrong script 
temp.z = MOUSE_POS.Z; this is useless
change to temp.z = 9999.99;
and loop this !
function mouse_test()
{
while(1)
{
temp.x = MOUSE_POS.x;
temp.y = MOUSE_POS.y;
temp.z = 9999.99;
vec_for_screen(temp, camera);
wait(1);
}
}
then in tree action/function
my.enable_mouse = on;
my.enable_touch = on;
my.event = mouse_event;
function mouse_event
{
if(event_type == event_touch)
{my.transparent = on; my.alpha = 50;} //to check is it working
if(event_type == event_release)
{my.transparent = off;}
}