WARNING: line.width is deprecated. Use line.strokeWidth.

Hi guys,

Apologies if this was addressed before, (i tried searching around but couldn’t find any answers) but when I tried applying the codes to do slash effect on screen (Fruit Ninja style), Im getting a whole bunch on warnings on my mac Terminal each time i swipe. 

“WARNING: line.width is deprecated. Use line.strokeWidth.”

for i,v in ipairs(endPoints) do local line = display.newLine(v.x, v.y, event.x, event.y) line:setStrokeColor( 1,1,1 ) line.strokeWidth = 10 transition.to(line, { alpha = 0, width = 0, onComplete = function(event) line:removeSelf() end}) end

Originally the code was “line.width = 10” but changing it to “line.strokeWidth = 10” yields the same result as well. 

It’s hard to troubleshoot my game when the entire terminal is filled with those warnings. 

Can anyone help? 

If you are using full Gfx2 and following these instructions, you should be fine:

http://docs.coronalabs.com/daily/api/type/ShapeObject/strokeWidth.html

There are options to control terminal messages, but you’ll need to check the documentation (I can’t find it right now.)

The best solution, of course, is to fix the problems indicated by the messages.

Thanks for the response.

At a glance it seems like there’s nothing wrong with the code. It baffles me. 

Guess I will continue to test things further. 

You’ll need to change width to strokeWidth in your transition.to as well…

*facepalm* I can’t believe I missed that.

Thank you so much! The warning is gone now  :slight_smile:

:wink:

If you are using full Gfx2 and following these instructions, you should be fine:

http://docs.coronalabs.com/daily/api/type/ShapeObject/strokeWidth.html

There are options to control terminal messages, but you’ll need to check the documentation (I can’t find it right now.)

The best solution, of course, is to fix the problems indicated by the messages.

Thanks for the response.

At a glance it seems like there’s nothing wrong with the code. It baffles me. 

Guess I will continue to test things further. 

You’ll need to change width to strokeWidth in your transition.to as well…

*facepalm* I can’t believe I missed that.

Thank you so much! The warning is gone now  :slight_smile:

:wink: