flamendless / Slab

An immediate mode GUI for the Love2D framework.
MIT License
289 stars 25 forks source link

Style resets #88

Closed flamendless closed 3 years ago

flamendless commented 3 years ago
function love.load()
        --other initiliazation
    local style = Slab.GetStyle()
    style.API.LoadStyle("slab.style", true)
    print(style.API.GetCurrentStyleName()) --slab
end
function love.update(dt)
    local style = Slab.GetStyle()
    print(style.API.GetCurrentStyleName()) --DARK

    style.API.SetStyle("slab.style")
    print(style.API.GetCurrentStyleName()) --slab
        Slab.Update(dt)
end

why does in love.update, the current style resets back to dark?

flamendless commented 3 years ago

Apparently LoadStyle should be called after Slab.Initialize to avoid getting overridden. Updated the wiki to make note of this for clarity