So I'm making an Android app/game using Unity where the user is able to "draw" by touching the screen. The drawings will be pixel art -- basically, a pixel art drawing function -- so everything should be pixel perfect.

Some functions I will add are:

  1. Changing brush size
  2. Changing brush color
  3. Filling areas
  4. Erasing

A game called Worldbox has a pretty similar function, where users are able to draw "land."

I thought about using the tilemap function of Unity, and even made a program that does all #1~#4 well. However, if the tilemap(drawing size) exceeds 100*100 tiles, the app took forever to load, and I concluded that tilemaps weren't suited for drawing programs.

A friend of mine said that I would have to make some kind of "editor" for this application, and Unity just isn't fit for that.

However, I only know how to make applications using Unity, so are there any Unity functions I can use to make this app?

The answer could be very simple(ex. Just use the tilemap function). It doesn't have to explain how I could make this app, but what I could use.

  • \$\begingroup\$ It seems like everything you need is provided by the SetPixels32/GetPixels32 methods of a Texture2D, class, together with standard algorithms like flood fill, which are straightforward to implement in Unity's C#. Can you elaborate on where you get stuck when trying to use these features to manipulate image pixels the way you have in mind? \$\endgroup\$
    – DMGregory
    Oct 18, 2021 at 5:00
  • \$\begingroup\$ See also Efficient modification of Texture2D at runtime for a 2D painting game in Unity, where I have an answer describing how to do your painting GPU-side via a RenderTexture, though this might not be necessary for low-resolution pixel art, and might make pixel perfection a little more challenging to achieve (though certainly not impossible). \$\endgroup\$
    – DMGregory
    Oct 18, 2021 at 5:03
  • \$\begingroup\$ @DMGregory Well, I'm still learning Unity, so there are lots of functions I don't know. I found this feature called "tilemap," and thought it would be great for making pixel-perfect drawing...but it wasn't good for having many pixels/tiles. Now, I just don't know how I'll be able to make a pixel painting function without using tilemaps. Also, thanks for all the links! They're very helpful :) \$\endgroup\$
    – Howler
    Oct 19, 2021 at 10:29
  • \$\begingroup\$ Sounds like you might want to start with some beginner tutorials then. Typing "how to make painting unity" turns up a bunch of guides on the first page of results, and they'll usually be better at walking you through the process start-to-finish than an answer here. Post here when you need help with one specific step or problem. \$\endgroup\$
    – DMGregory
    Oct 19, 2021 at 11:37

1 Answer 1


If you’re painting an image with pixels, why not just actually paint the pixels? Set a low res UI image and then figure out where in the image clicks or taps happen. Then paint the pixel? Then you can redraw the image using the optimized image manipulation functions already built into unity.

The main challenge will be converting between click coordinates to pixel coordinates. But if you know/control the size of the screen and the size of the image, that shouldn’t be super hard.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .