mouse_ent does not work in my application

Posted By: Aku_Aku

mouse_ent does not work in my application - 09/19/16 16:25

I started the engine in my application. I created a panel, a text, and a button on the panel. They are works.
The text can be see on the panel with its content. The button can be see on the panel and reacts on mouse click.
My program is able to follow the position of the mouse, and the x-y values are also displayed on the panel.
But, when i want to use the mouse_ent function to detect which entity is under the pointer i got always 0x0 back.
What do i do wrong?
I set the mouse_mode to 2 and to 4, results were same.
Thanks in advance.
Posted By: txesmi

Re: mouse_ent does not work in my application - 09/19/16 18:01

Hi,
try encreasing 'mouse_range'.

Salud!
Posted By: Aku_Aku

Re: mouse_ent does not work in my application - 09/19/16 18:52

Thanks for the advise.
I tried with 9000, nothing was changed.
Posted By: jenGs

Re: mouse_ent does not work in my application - 09/20/16 09:19

yea, had this problem, too. I think it is an error/bug. I asked a long time ago for a fix. Never came.
Posted By: Quad

Re: mouse_ent does not work in my application - 09/20/16 10:31

just scan it yourself. check mouse_dir3d or something like that on manual.

also mouse_mode is involved in some way for mouse_ent.
Posted By: 3run

Re: mouse_ent does not work in my application - 09/20/16 11:24

It used to work for me... I'll check it out.

Edit: well, this code works for me.. Maybe I didn't understand your problem?
Code:
action cube(){
		
	while(1){
		
		if(is(my, TRANSLUCENT)){
			reset(my, TRANSLUCENT);
		}
		
		wait(1);
	}
}

void main(){
	fps_max = 60;
	level_load("");
	
	mouse_mode = 4;
	
	ent_create(CUBE_MDL, vector(200, 0, 0), cube);
	ent_create(CUBE_MDL, vector(200, -25, 0), cube);
	ent_create(CUBE_MDL, vector(200, 25, 0), cube);
	
	while(1){
		
		if(mouse_ent){
			set(mouse_ent, TRANSLUCENT);
		}
		
		wait(1);
	}
}

Posted By: Aku_Aku

Re: mouse_ent does not work in my application - 09/20/16 15:28

Thanks for the replies to jenGs, Quad and 3run.
@jenGs: i remember i had such code that worked, in lite-c. The situation is changed now.
@Quad: I don't know how could be involved mouse_dir3d when there are only one panel and one text. I mentioned in the opening post i tried mouse_mode=2 and mouse_mode=4 too.
@3run: It is a pity, but your code seems to as a simple lite-c one, processed by the compiler provided by the Gamestudio.

This program is a mix of c++ and lite-c. Compiled with Qt. I would use your advises, but they are not fit into this environment.
I thought it is clear for everyone, if this post is here in External Languages chapter, i use the SDK with third party compiler.

I think i misunderstood what is the object of this function.
It is ENTITY, but not panel or text.
Thanks guys, i am sorry.

Last remark, i recognized, what i was looking for really, is the mouse_panel
© 2024 lite-C Forums