how to draw a line dynamically when mouse move

  • If old position is the same as current -> nothing is displayed. In other cases that mean mouse is moved -> display coordinates:

    Code
    <action name="check_mouse_coordinates">
    	set(mouse_x,get(mouse.stagex));set(mouse_y,get(mouse.stagey));
    	ifnot(mouse_x_old EQ mouse_x,ifnot(mouse_y_old EQ mouse_y,txtadd(curr_coor,'x:',get(mouse_x),' y:',get(mouse_y) );showtext(get(curr_coor),yourstyle);copy(mouse_x_old,mouse_x);copy(mouse_y_old,mouse_y);););
    	delayedcall(0.01,check_mouse_coordinates(););
    	</action>


    See how it works: Link
    Code: Here

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!