It’s easier to explain my goal with context. I’m developing a semi-realistic fusion reactor simulation. I’m planning to have displays that show a 2d view of the plasma, with the color of each “pixel” representing that small area’s temperature on a scale of 0-20keV
Essentially it’s a 2d display that displays each pixel a specific color that is obtained from a number relative to a minimum and maximum.
However, I’m not really sure how to go about doing this. I tried using command bar to generate a grid of UIFrames, but as you can imagine, generating 10,000 instances at once didn’t really end too well. I also tried using EditableImages, which would work well, except they’re not available in production clients without the modification of fast flags, which I’d rather not force my players to do.
How should I go about doing this?
For reference, this is what the display will look like (without the grid)
My best guess is that you create an image-animation for this e.g., draw an image of what it looks like when it hasn’t started to fill up yet, and create frames for this bar by making image labels and, through srcipt, change the imageID to the next frame you drew for the next % loaded on that bar.
Do you mean pre-render images of the display for certain conditions? This wouldn’t really work since the way it will be used means it has to change dynamically depending on certain other variables.
Okay here. It’s like how 2-d Animations are made; frame by frame. You could draw a specific percentage frame for each percentage that the bar goes to in your game and, through script, the ImageID will change to whatever that Frame is for the corresponding percentage.
Oh, I meant 2d display as in there is a grid of pixels where each pixel’s color corresponds to it’s own individual value. It doesn’t use images for anything; the bar on the left is just a reference for what the colors mean.
Ideally you would use an image label and set it to have pixelated resampling. This would use the most reasonable amount of memory.
If you absolutely need to have a dynamic set of pixels, there is a great resource on the forum that you can use to do this:
It’s very well optimized for drawing pixels, though be warned it will probably still take somewhat significant amounts of memory. If possible, I would create a set of images and cycle through those instead.