How can I have icons of things in my game?

I have a menu of things to select in my game. What it basically looks like, only watch the first 5 seconds. I’ve created everything, except the icons themselves. Right now I just have blank image buttons.

Now, how would I create the icons? I’m thinking somehow something takes a picture, but how would that work? My only solution so far is creating a really low resolution camera, that basically colors 10,000 little 1x1 pixel Frames. It takes ages to load, and freezes my game every time a picture is taken.

Are there any other alternatives? Loading the things that need their pictures taken, themselves? And putting them into little viewports? I feel like that would be horrendously laggy, and the internet usage would be comical. Loading in dozens of entire saves would be pretty brutal…

Thanks!

You can use a viewportframe and set the camera to the workspace CurrentCamera. After this, whenever you take an image or something like that, clone everything in the workspace to the viewport (you can do frustum culling to remove objects you cant see) and update their current CFrames. You’ll get a decent result but note that the lighting wont exactly match.

Edit: Viewports are completely viable you just have to be smart about what you load.

That might be an option. So what I basically do is:

Reuse my camera take picture script, but instead of getting the color of the raycast instance, I save the raycast instance to a table, serialize the table, and don’t save everything those 10,000 raycasts didn’t touch. (I can probably do every other pixel, but my viewport is already so small, I don’t want to lose any more information…)

Is that correct? Thanks!

That could work just note that it would not be perfect. Because it is only 10k raycasts some parts may slip through, so you never really know.

10k sounds like a lot, but yeah, parts will for sure be slipping though :joy:
Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.