Allow to overwrite draw function per widget
This commit is contained in:
parent
18880de088
commit
4f3d285218
9 changed files with 16 additions and 9 deletions
|
@ -28,8 +28,10 @@ return function(core, normal, ...)
|
|||
img = opt.hovered
|
||||
end
|
||||
|
||||
core:registerDraw(love.graphics.setColor, 255,255,255)
|
||||
core:registerDraw(love.graphics.draw, img, x,y)
|
||||
core:registerDraw(opt.draw or function(img,x,y, r,g,b,a)
|
||||
love.graphics.setColor(r,g,b,a)
|
||||
love.graphics.draw(img,x,y)
|
||||
end, img, x,y, love.graphics.getColor())
|
||||
|
||||
return {
|
||||
id = opt.id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue