Add a Canvas GUI for painting pixels on the screen

This is not a new feature per se, more like an improvement of the current system. Right now, if you want to paint something on the screen pixel-by-pixel, you use 1x1 frames. This does work, but it can cause the framerate to drop, effectively crashing the game or ruining the experience.

My proposal is to introduce a Canvas GUI object which has a method for setting pixel colors and their opacities in specific positions. As mentioned before, this won’t introduce any security or safety issues, as the functionality already exists using frames. The only thing that would change is decreasing lag associated with it. Doing so could allow for 2D animations, special effects, or even mini videos (like tutorials) being displayed in the game without the associated lag.

Something like this:

local canvas = Instance.new(“Canvas”, game.StarterGui.MyGui)
canvas.Size = UDim2.new(0, 150, 0, 150)
canvas.ZIndex = 10
canvas:SetPixel(x, y, Color3.new(r, g, b), opacity)
canvas:ClearPixels()

In summary, the advantage to this is that it would allow developers to draw pixels to the screen without the extra lag caused by frames. There is not really a disadvantage considering you can achieve this exact functionality with 1x1 frames.

93 Likes

Like this
https://trello.com/c/zZScjDiC/256-vector-graphics-drawing-in-ui-xl ? - it’s been suggested before, and although I know this is a little different, but it seems similar to the intended use of your feature request, and seems like less method calls :slight_smile:

9 Likes

You mean Pen?

Adding canvas means we intend this to work. The 1x1 frame pixel-art is not an intended feature. Due to the security/safety issues, this specific thing might be restricted in the future.

7 Likes

But why?

3 Likes

That’s like saying that making buildings out of bricks is not an intended feature. The fact of the matter is that people will always be able to find a way to make inappropriate things. The only difference is that right now people only do it to make inappropriate things, not useful things, as its bad for efficiency.

29 Likes

I agree with @RBX_Lua. If someone uses the feature inappropriately, they can be reported like someone who built the same things out of tiny bricks. If we locked down every single feature that was potentially abusable, ROBLOX wouldn’t exist – this is precisely the reason Report Abuse exists.

31 Likes

Use case?

Maybe blood splatter or small effects like shadowing or if there is something behind a wall for example and I want to make a “sensation” kind of a thing, I could color that part green. Or something like vignetting the screen. There are many things you can do that I currently can’t imagine.

7 Likes

Making a dynamic minimap without killing performance or having a super low resolution for it

14 Likes

To get a better way of doing circular progress bars?
And - either if we can get data about image resources / load in pixel data off-site, we can get round pictures of player avatars properly.
Icon animations - instead of uploading spritesheets for that fancy star-animation, it can be made using a canvas! And it would even be scalable then, probably.

4 Likes

Bumping this topic because I was just about to suggest this exact features.

Currently it’s waaaay too complex to create any kind of minimap. Screenshots from above the map don’t work because camera’s can’t have a FoV of 0, so the sides of a top-down screenshot will always be from an angle. The only alternative solution it to create 1x1 frames for every X studs, but that will totally kill performance in no time. A canvas element would make this process really simple.

There are also games on Roblox which involve drawing on a board like MeepCity or Doodley. This is usually done physically with parts, but a canvas would enable developers to easily recreate this feature in 2D.

Additionally, canvas elements could be used to make heatmaps in Roblox. Wouldn’t it be cool to have shooter games on Roblox in which you can view personal heatmaps of where you died in each map? It would be a cool feedback mechanic for players.

You do not have to restrict the functionality at all. GUIs are local, nothing you draw on your screen is replicated. If a developer decides to implement a feature that allows canvas drawings to be shared between players in a server, then you could technically blame that developer instead for allowing inappropriate content to be displayed to innocent children. Although I think it’s unnecessary to protect such a feature for the tinniest chance of something going slightly wrong. Games like Minecraft had no security for inappropriate creations anywhere, yet I have never seen a news article about kids building inappropriate structures on public servers.


I think a canvas GUI element has a lot of different uses which are currently (almost) impossible to implement without it. I think it would therefore be a good addition.

26 Likes

We need this.

20 Likes

Bumping this topic because I feel like it could use some more attention as this feature has many valid use cases. Zomebody made some good points such as minimaps being quite difficult to do since we are restricted to using 1x1 frames. Another example would be ScriptOn’s custom camera rendering system, it could greatly benefit it’s functionality by reducing the lag greatly thus allowing him to do higher quality renders with it. I also agree with the OP and Zomebody that there’s not a need to restrict the functionality of it as this feature technically already exists with 1x1 frames. This feature would simply decrease the lag and make it more applicable/efficient than using 1x1 frames.

6 Likes

A post was merged into an existing topic: Off-topic and bump posts

Found myself in need of this recently when messing around with fractal rendering (takes me about 20 seconds to create an array of 200x200 frames and I have to force close Studio when done as it will crash otherwise).

A simple, but important use case I can think of is a generated 2D map for procedural worlds. I saw that a lot of recent hack week projects and general features revolved around procedural and infinite places, but it is still impossible to provide players with what is a crucial gameplay feature.

13 Likes

We desperately need this.

The major concern with adding this is security, in that you could draw something inappropriate on the screen. This concern does not make sense, though, when you consider the fact that you can make the same inappropriate thing in 3 dimensions using bricks. (same things @RBX_Lua and @EchoReaper said). If I really wanted to make something inappropriate, I could do the same thing using frames and a 2d greedy “meshing” algorithm.

This just opens up the ability to create anything we want using 2 dimensions. There are an insane amount of use cases for this (read above), the fact that this doesn’t exist is just mind boggling.

21 Likes

It only takes 6 frames to draw a nazi symbol. If people want to troll, preventing this isn’t going to stop them.

8 Likes

Sure, but having a canvas object makes it feasible to draw (animated) high-resolution inappropriate images that haven’t gone through moderation. It’s not impossible to do without the feature (you can draw a bunch of pixel frames), but it’s much more involved and will likely have a very large performance impact / limit to how many frames you can render in UI at once, which discourages that approach and so reduces abuse.

Simple shapes (like swastika) are not within the scope of that argument of course, since you can display them performantly with only a few strokes of frames/parts. It’s about discouraging more serious abuse.

5 Likes

Yeah… No this isn’t true.

Firstly we can play already play video on the screen, see:

~~https://dl.dropboxusercontent.com/s/0r0c2i88brlll0d/GSpguRCJYX.mp4~~

and show high resolution full color images:

~~https://media.discordapp.net/attachments/142748177592877056/680124263138852946/unknown.png~~

Neither the video nor those textures on the renderer were moderated and it doesn’t actually have that big of a performance impact. On my S21+ it doesn’t even drop my framerate after being drawn. So it’s not “a bunch of pixel frames”, it’s anything you want.

And, I don’t think the exploiter cares if your framerate drops to 10 or 5. This argument is mute and I remember playing SFOTH something 10 years ago and seeing inappropriate frames being drawn on my screen. It’s not discouraging serious abuse either, it would probably take maybe an hour for an exploiter to figure out how to do this. So this argument just doesn’t work.

Thanks for the awesome draw method by @ShoesForClues

16 Likes