Instead of importing graphics, is there a clean way to draw a dashed line, or shape? [import]uid: 118600 topic_id: 33538 reply_id: 333538[/import]
Unfortunately, the answer is “not really”. The best you can do is draw a series of short line segments (each one a line itself) in a loop. This isn’t difficult on a straight line, but if you want to curve it around or bound a polygon with a dotted line, an image is a much better approach. Additionally, a series of many little lines creates a lot of display objects, which takes up a bit more memory.
Does this answer help somewhat?
Brent [import]uid: 200026 topic_id: 33538 reply_id: 133325[/import]
Check out this function for line drawing:
http://developer.coronalabs.com/code/line-drawing-tutorial
It has nothing specific about dashed lines, but their is a section on temporary lines or erasing lines so you may have to modify the code a little, perhaps having the line drawn and parts of it are erased as it is drawn to make it look lie the user is drawing a dashed line. [import]uid: 75779 topic_id: 33538 reply_id: 133349[/import]
Unfortunately, the answer is “not really”. The best you can do is draw a series of short line segments (each one a line itself) in a loop. This isn’t difficult on a straight line, but if you want to curve it around or bound a polygon with a dotted line, an image is a much better approach. Additionally, a series of many little lines creates a lot of display objects, which takes up a bit more memory.
Does this answer help somewhat?
Brent [import]uid: 200026 topic_id: 33538 reply_id: 133325[/import]
Check out this function for line drawing:
http://developer.coronalabs.com/code/line-drawing-tutorial
It has nothing specific about dashed lines, but their is a section on temporary lines or erasing lines so you may have to modify the code a little, perhaps having the line drawn and parts of it are erased as it is drawn to make it look lie the user is drawing a dashed line. [import]uid: 75779 topic_id: 33538 reply_id: 133349[/import]
Thanks, Brent. Sounds like I’ll just have to create some external graphics and import them. I was hoping to generate nearly everything in-app, but it sounds like my original plan just won’t work. [import]uid: 118600 topic_id: 33538 reply_id: 134114[/import]
Thanks, Brent. Sounds like I’ll just have to create some external graphics and import them. I was hoping to generate nearly everything in-app, but it sounds like my original plan just won’t work. [import]uid: 118600 topic_id: 33538 reply_id: 134114[/import]
Hello folks, in case anyone hits this post again, you now may use :
line.stroke.effect = “generator.marchingAnts”
found this answer here : http://coronalabs.com/blog/2013/10/24/tutorial-fills-and-strokes-in-graphics-2-0/
Hello folks, in case anyone hits this post again, you now may use :
line.stroke.effect = “generator.marchingAnts”
found this answer here : http://coronalabs.com/blog/2013/10/24/tutorial-fills-and-strokes-in-graphics-2-0/