Events

Posted By: TrackingKeks

Events - 08/24/10 19:19

Hello,
I have tried to use EVENT_CLICK, EVENT_RELEASE and EVENT_TOUCH with a simple cube for testing. All of them are working but they aren't working correctly. The mouse does not detect the entities every time..
But why? Any ideas?
Thanks for your help

Here is some code
Code:
PANEL* baumodus_idee_loeschen1_pan =
{
	button=95,260,"ok1s.tga","ok2s.tga","ok1s.tga",baumodus_idee_loeschen_objekt(),NULL,NULL;
	button=320,260,"abbrechen1.tga","abbrechen2.tga","abbrechen1.tga",baumodus_idee_loeschen_hide(),NULL,NULL;
	layer = 13;
   flags |=OVERLAY,TRANSLUCENT;
   bmap = "baumodus_loeschen.tga";
}
...

function baumodus_idee_loeschen()
{
	if(event_type == EVENT_CLICK)
	{
		test_ent=mouse_ent;
		baumodus_idee_loeschen1_pan.pos_x = (screen_size.x - bmap_width(baumodus_idee_loeschen1_pan.bmap))/2; 
   	baumodus_idee_loeschen1_pan.pos_y = (screen_size.y - bmap_height(baumodus_idee_loeschen1_pan.bmap))/2; 
		baumodus_idee_loeschen1_pan.flags|=SHOW;
	}
	if(event_type == EVENT_TOUCH)
	{
		mouse_map=cursor_delete_tga;
	}
	else if(event_type == EVENT_RELEASE)
	{
		mouse_map=cursor_pcx;
	}
}
...
my.emask = ENABLE_CLICK|ENABLE_TOUCH|ENABLE_RELEASE;
my.event = baumodus_idee_loeschen;
...


Posted By: TrackingKeks

Re: Events - 08/28/10 16:59

Nobody can help me?

I'll try to explane the problem again:
When I'm moving my mouse over an entity, the cursor should be changed but the mouse is changed and the event is called only sometimes.
I've tested it with different entities and there were the same results:
I had to search after a clickable position.

Hope somebody knows how to solve this problem^^
Posted By: MrGuest

Re: Events - 08/29/10 08:52

Have a look at mouse_range though the way you're trying I've not ever tried.

I always write anything like this with mouse_ent, if you need an example of that let me know.
Posted By: TrackingKeks

Re: Events - 08/29/10 11:45

Thanks for your help!
mouse_range changing has not solved the problem because it was my mistake:
I had forgotten a function which generates fog about all entities near the camera. This explains the strange script behaviour too because the fog layed about all other entities.
© 2023 lite-C Forums