EgoMooseOldProjects / Rbx_CustomFont

A custom font management system for Roblox
MIT License
21 stars 17 forks source link

Optimization #1

Closed EgoMoose closed 8 years ago

EgoMoose commented 8 years ago

Currently when using text boxes or changing text frequently (especially when the string is long) there can be a fair amount of lag.

Potential solution is to prepare the sprite boxes ahead of time so that they don't have to be instanced every time.

-- Something like this...
local function prepareCharacters()
    characters = {};
    for _, size in pairs(settings.data.info.sizes) do
        local size = tostring(size);
        characters[size] = {};
        for byte, data in pairs(settings.data.sizes[size].characters) do
            characters[size][byte] = drawSprite(byte, size);
        end;
    end;
end;

Although with little testing I can confirm that so far this solution doesn't look particularity fruitful