So I think I found a pretty significant bug in Gspot. If you look at the following example, you'll notice I have 3 scrollgroups and 3 buttons. Each button sends text to the appropriate scrollgroup. The problem here is that it looks like you can only have a single scrollgroup at any one time on screen that is functional. It will always be the last one created. All of the ones created prior seem to be completely borked. They do not have scroll bars and children cannot be added to them.
Any ideas on how to fix this? I am working on a chatbox that requires multiple scrollgroups to separate content into channels and currently only the last one works.
Code: Select all
gui = require('Gspot')
font = love.graphics.newFont(12)
love.load = function()
love.graphics.setFont(font)
sometext = 'Lorem ipsum dolor sit amet.'
scrollgroup = gui:scrollgroup(nil, {0, gui.style.unit, 128, 128})
scrollgroup2 = gui:scrollgroup(nil, {150, gui.style.unit, 128, 128})
scrollgroup3 = gui:scrollgroup(nil, {300, gui.style.unit, 128, 128})
button = gui:button('text', {x=0, y=192, w=56, h=16})
button2 = gui:button('text', {x=150, y=192, w=56, h=16})
button3 = gui:button('text', {x=300, y=192, w=56, h=16})
button.click = function()
scrollgroup:addchild(gui:text(sometext, {w=128}), 'vertical')
end
button2.click = function()
scrollgroup2:addchild(gui:text(sometext, {w=128}), 'vertical')
end
button3.click = function()
scrollgroup3:addchild(gui:text(sometext, {w=128}), 'vertical')
end
end
love.update = function(dt)
gui:update(dt)
end
love.draw = function()
gui:draw()
end
love.keypressed = function(key, code)
gui:keypress(key, code)
end
love.mousepressed = function(x, y, button)
gui:mousepress(x, y, button)
end
love.mousereleased = function(x, y, button)
gui:mouserelease(x, y, button)
end
Also, if I may add, if there is a plan to fix the scrollgroup's finickiness, could I request some added features such as:
- Ability to align text/children in an element (example: right justify or align from bottom)
- Ability to prepend children instead of appending them
- Scroll from bottom (think a chat window in virtually every game ever)