Disable Line draw in extra.worldClickAdd

Hi,

I have been able to draw lines in the extra.worldClickAdd world , but i have not been able to disable the drawing feature here , how can i disable lines from being drawn , i have tried disabling the world and pausing it but it seems to create problem ...

What i want is after drawing lines , when i press a button after that i should not be able to draw any thing on the world ....

Thanks in advance ...

Regards
Jin
Have you tried disabling the handleMouseDown function in extras.WorldClickAdd? Maybe removeEventListener would work but it it doesn't, you could add another boolean variable and enable /disable drawing based on the value in the handleMouseDown function.
@Istvan - thanks a lot

this is what i did -

i took a boolean draw1 - then on a button click i set it to true and coded this inside an enterframe

////////---------------
if(draw1==false)
{
listenWhileVisible(stage, MouseEvent.MOUSE_DOWN, handleMouseDown);
}
else if(draw1==true)
{


}



///////---------------

I can still draw and drawing does not get disabled , i did this inside the gamefile not inside the wck.worldClickAdd

thanks for the time again

Regards
Jin
Can't seem to be disable - listenWhileVisible(stage, MouseEvent.MOUSE_DOWN, handleMouseDown);

even if i try removeeventlistener or use a boolean and then try calling it ...

How can i remove the listenWhileVisible , kindly guide ...

Regards
Jin
Hi,

I have tried pretty much every thing , right from creating the exact same functions as in WorldClickAdd and trying to disable handleMouseDown , but it seems it always access the class in the main folder ...

Also i am unable to influence the values inside handleMouseDOwn , even if i create its instance and then access the properties inside it ...

Any guidance is welcome ...

Regards
Jin

Original thread: https://box2d.org/forum/viewtopic.php?t=9632