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.
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.
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.
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.