Looking for a programming technique

Hi,

I’m looking for a programming technique. I don’t know how named this but I´m looking info about how I can how to make a stroke on screen… for example, In Okami from Capcom, you can paint spells in screen with a brush.

I would get the same effect, but I don´t know how looking info about it, because I’dont know how to look for it.

Thanks for your comments!
Regards!

Mmm… maybe the answer is drawing shapes…

Maybe you can create some kind of (invisible) grid, check where the user started drawing and where he stopped, then check for every cell that got drawed on if it’s close to a cell used on an existing drawing.
I’m not sure at all about this being an efficient way of doing it though.

I would probably draw the strokes with Vectrosity. It’s not free, but it’s a very well-designed and well-supported asset.

Hi hlw, JoeStrout, thanks for your answers!!

I need draw shapes as in this video:

but not complex shapes, maybe one or two strokes.

Regards!

Oh, my brain got stuck on “Okami”, i thought you were searching for a way to recognize shapes and use it as an input.
If you want to draw lines i guess i would use the Line Renderer, , check for the Camera.main.ScreenToWorldPoint(Input.mousePosition); , create points with it, maybe check angles between every set of 3 points (if the angle difference is too close from 0 you can delete the points in between, if the angle is too huge for a few set in a row, create more moints in between and smoother the angles), maybe check the distance between every point and use it to add some fancy effects (if the points are close to each other the user is drawing slowly and i would maybe add width to the line around those points, make it thinner when drawing quickly).

Use a material opaque in the center, and smoothly becoming a transparant circle I guess.

I’m actually creating a map editor for my platformer, and will maybe need to create a hand drawing platform feature.
I don’t need an high performances thingy for an editor, and maybe a line renderer with like a thousand points and some hundreds of angles and distances checking isn’t the best thing to do. I’m not even sure it would render well.
If this feature is important and need real performances (and maybe if I need to use it for multiple projects), I would consider using vectrosity . Let me know if and how you acheive to do this.

Yes, I understand that. I stand by my recommendation of Vectrosity.

I hope I’m not confusing you. I take Okami example, because in this, you drew the shape and it appeared on the screen. In the video I show above I show the suabity with which the form is made.

The final effect is as in Okami, but doing the strokes smoothly. For example: http://www.laps4.com/juegos/imagen-de-Okami-HD-23681.jpg

My English is not very good, I hope and it has given me to understand and what you proposed to me before remains the correct thing :confused:

Thanks for yours comments!
Regards!

You could potentially use a TrailRenderer with a long lifetime and a painterly trail material.

Maybe I can use something as it:

Can this work on a 2D environment?

Thanks for your comment!
Regards!

Yes.

Ok, I’m studing it and I try to apply.

Thanks very much to all! :smile: