Help with drawing a line and physics

6 replies [Last post]
ebertole
User offline. Last seen 1 week 4 days ago. Offline
Joined: 17 Jul 2011

Hi guys,

I would like to know how can I draw a line in CORONA SDK that appear

on the screen

while I'm drawing it, not just when I release my finger from the

screen. And then, how will I be able to add physics to my line??

Thanks a lot!!! :D

Replies

MeApps's picture
MeApps
User offline. Last seen 16 hours 1 min ago. Offline
Joined: 4 Jun 2011
ebertole
User offline. Last seen 1 week 4 days ago. Offline
Joined: 17 Jul 2011

Thanks a lot!! Now do you now how can I delete the previous line when I draw a new one?

MeApps's picture
MeApps
User offline. Last seen 16 hours 1 min ago. Offline
Joined: 4 Jun 2011

No problem. Yes you can do that. You can have line be in a group display. Here is resource you should look at:

http://developer.anscamobile.com/code/easy-finger-drawing-undo-functionality

ebertole
User offline. Last seen 1 week 4 days ago. Offline
Joined: 17 Jul 2011

Thanks a lot, but my question was if I can draw a first line and THEN when I draw a second line the firts one dissapear

MeApps's picture
MeApps
User offline. Last seen 16 hours 1 min ago. Offline
Joined: 4 Jun 2011

Ah, I see. Same concept. I have this in this app:

I have that function in this app:

http://itunes.apple.com/us/app/coachme-football-edition-lite/id455354813?ls=1&mt=8

You'll notice you can draw routes on the players and if you draw on the same player it erases the previous one.

All you have to do is insert the line in a display group. and remove it from the group in your touch event in the begin phase...

ebertole
User offline. Last seen 1 week 4 days ago. Offline
Joined: 17 Jul 2011

ok, now I will try! Thanks!

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.