Skip to content

Instantly share code, notes, and snippets.

@headjoe3
headjoe3 / pixOptimize.lua
Last active October 3, 2021 14:02
UIGradient Pixel Rendering
--[[
Optimized pixel rendering by Hexcede
Version 1.0
How do I use it?
The only function contained on the PixOptimize module is the Generate function. It takes a 2D array of pixels and returns a Frame containing the generated image.
How does it work?
This works by using UI gradients to render pixels instead of individual frames. It splits the image into 1x20 (could be increased in the future if Roblox supports ColorSequences with >20 values) strips which are colored using a single UIGradient instance.
What are some current problems with this method?
Due to the interpolation of UIGradients slight visual artifacting WILL occur. The perlin noise debug mode included in the demo script shows this artificting best.
@headjoe3
headjoe3 / Maid.lua
Last active March 20, 2019 20:18
Simple maid class
-- Makes destructors easy to create
local FastSpawnEvent = Instance.new("BindableEvent")
FastSpawnEvent.Event:Connect(function(callback, argsPointer)
callback(argsPointer())
end)
local function createPointer(...)
local args = { ... }
return function()