Refonte pour utiliser le systeme de GUI #112
2 changed files with 8 additions and 4 deletions
|
@ -19,6 +19,13 @@ function CanvasElement:initCanvas()
|
||||||
self.canvas.padding = 8
|
self.canvas.padding = 8
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function CanvasElement:updateElement(dt)
|
||||||
|
CanvasElement.super.updateElement(self, dt)
|
||||||
|
if (self.canvas.needRedraw or self.canvas.isAnimated) then
|
||||||
|
self:redraw()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function CanvasElement:getCanvasDimensions()
|
function CanvasElement:getCanvasDimensions()
|
||||||
return self:getDimensions()
|
return self:getDimensions()
|
||||||
end
|
end
|
||||||
|
|
|
@ -140,11 +140,8 @@ end
|
||||||
-- UPDATE FUNCTIONS
|
-- UPDATE FUNCTIONS
|
||||||
|
|
||||||
function Menu:updateElement(dt)
|
function Menu:updateElement(dt)
|
||||||
Menu.super.updateElement(self, dt)
|
|
||||||
self.widget:update(dt)
|
self.widget:update(dt)
|
||||||
if (self.canvas.needRedraw or self.canvas.isAnimated) then
|
Menu.super.updateElement(self, dt)
|
||||||
self:redraw()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- DRAW FUNCTIONS
|
-- DRAW FUNCTIONS
|
||||||
|
|
Loading…
Reference in a new issue