parent
77d793dc66
commit
16f3ea023b
1 changed files with 13 additions and 4 deletions
|
@ -11,9 +11,9 @@ function gui.newBorder(width, height, middlePosition)
|
||||||
tilequad[3] = love.graphics.newQuad(40, 0, 20, 20, w, h)
|
tilequad[3] = love.graphics.newQuad(40, 0, 20, 20, w, h)
|
||||||
tilequad[4] = love.graphics.newQuad(60, 0, 20, 20, w, h)
|
tilequad[4] = love.graphics.newQuad(60, 0, 20, 20, w, h)
|
||||||
|
|
||||||
local Texture = love.graphics.newCanvas(width, height)
|
local canvas = love.graphics.newCanvas(width, height)
|
||||||
|
|
||||||
love.graphics.setCanvas(Texture)
|
love.graphics.setCanvas(canvas)
|
||||||
utils.graphics.resetColor()
|
utils.graphics.resetColor()
|
||||||
|
|
||||||
local height = math.ceil(height / 20)
|
local height = math.ceil(height / 20)
|
||||||
|
@ -37,7 +37,12 @@ function gui.newBorder(width, height, middlePosition)
|
||||||
|
|
||||||
love.graphics.setCanvas( )
|
love.graphics.setCanvas( )
|
||||||
|
|
||||||
return Texture
|
local imagedata = canvas:newImageData()
|
||||||
|
local texture = love.graphics.newImage( imagedata )
|
||||||
|
imagedata:release()
|
||||||
|
canvas:release()
|
||||||
|
|
||||||
|
return texture
|
||||||
end
|
end
|
||||||
|
|
||||||
function gui.drawBar(x, y, width, height)
|
function gui.drawBar(x, y, width, height)
|
||||||
|
@ -108,7 +113,11 @@ function gui.newTextBox(filename, width, height)
|
||||||
|
|
||||||
love.graphics.setCanvas( )
|
love.graphics.setCanvas( )
|
||||||
|
|
||||||
return canvas
|
local imagedata = canvas:newImageData()
|
||||||
|
local texture = love.graphics.newImage( imagedata )
|
||||||
|
imagedata:release()
|
||||||
|
canvas:release()
|
||||||
|
return texture
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue