Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Offseting GUIObjects ?

Asked by
ImageLabel 1541 Moderation Voter
9 years ago

I've been having a little bit of trouble with a "Notifications system" I've been working on, and the offsetting of GuiObjects. I was able to avoid the overlapping of the objects by getting the combined size[Y] of all notifications.

local function TotalOffsets(guiObject)
        local total =  0
        for k, v in next, guiObject:children() do
            if v:IsA('TextLabel') then
                total = total + tonumber(v.Size.Y.Offset)
            end
        end
        return total
    end
    

However, trying to limit the amount of notifications displayed at once causes a little flaw because the more I send notifications, the less time the older ones have time to dismiss, causing overlaps due > to the older ones still being counted as part of the TotalOffsets

Question: How to avoid all of the above?

Answer this question