show a panel when entity is touched, then disappear when it isnt

Posted By: dakilla

show a panel when entity is touched, then disappear when it isnt - 10/24/09 10:11

is there a way to show a panel when an entity is touched by the mouse (just use EVENT_TOUCH laugh ) and then remove the panel when the mouse is removed from the entity (this is the bit i am stuck with). Thanks
Posted By: flits

Re: show a panel when entity is touched, then disappear when it isnt - 10/24/09 10:28

never tested it but i gues it should work

Code:
function show_panel()
{
	if(event_type == EVENT_RELEASE) 
	{
	reset(panel,SHOW);
	}
	if(event_type == EVENT_TOUCH) 
	{
	set(panel,SHOW);
	}	
}

function entity_func()
{
	my.emask |= (ENABLE_TOUCH | ENABLE_RELEASE);
	my.event = show_panel;
...


Posted By: dakilla

Re: show a panel when entity is touched, then disappear when it isnt - 10/25/09 09:57

oh, cheers, forgot about Event release lol, thanks
© 2024 lite-C Forums