I'm trying to build a very watered-down version of ClipStudio and I'd like to have the option to undo strokes or delete whole lines (similar to OneNote) but I'm stumped on how to save a texture as a sprite.
Currently, my program is simply watching for when the mouse is clicked before it starts setting pixels. So,
I need to modify my program to figure out when a stroke ends
I need to figure out a way to save that stroke as a sprite
I'm currently running on a computer that doesn't have touchscreen so I thinking of using a boolean which is flips on/true when the user is drawing and off/false when the mouse button is no longer pressed. Is there a more efficient way to notice a stroke?
Now, the main conundrum. I've tried using NewSprite and Sprite.Create but the whole Rect thing is kind of confusing me. I've looked at the documentation for Create and Rect but I'm stumped as to how to use it with what I'm doing. The lines don't have a specific length or width so how could I use Rect? Also, when I attach the SpriteRender component to my canvas it seems to only save 1 sprite but I want to save a whole list of them.
If it's Unity, I believe there is the "line renderer" in "add component", you can try to use this.