Add display time progress bar

master
informatic 2017-01-17 17:51:48 +01:00
parent c41bb6c1dd
commit ffccb380f7
2 changed files with 11 additions and 0 deletions

View File

@ -1,6 +1,7 @@
return {
displayTime = 2,
transitionTime = 0.5,
showProgress = true,
nodes = {
{'nodes.at'},
{'nodes.cube'},

View File

@ -74,6 +74,16 @@ function NodeManager:render()
love.graphics.setColor(255, 255, 255, 255 * (self.stateTime / self.config.transitionTime))
love.graphics.draw(self.secondaryCanvas, 0, 0)
end
love.graphics.setColor(255, 255, 255, 100)
if self.config.showProgress and self.state == 'running' then
local stateTime
stateTime = self.currentNode.displayTime or self.config.displayTime
local h = 5
love.graphics.rectangle("fill", 0, love.graphics.getHeight() - h, (self.stateTime / stateTime) * love.graphics.getWidth(), h)
end
end
function NodeManager:update(dt)