Love2d support is updated to 11.1

May be bugs in supporting libraries, but the multitasking library is fully updated.

The guimanager may have a bug or 2, but I haven't found any ground breaking bugs that haven't been fixed
This commit is contained in:
2018-06-08 22:14:21 -04:00
parent a07fe49880
commit 89b4901e06
33 changed files with 515 additions and 470 deletions
@@ -1,7 +1,7 @@
function _GuiPro.gradient(colors)
local direction = colors.direction or "horizontal"
colors.direction=nil
trans = colors.trans or 255
trans = colors.trans or 1
trans=math.floor(trans)
if direction == "horizontal" then
direction = true
@@ -10,7 +10,7 @@ function _GuiPro.gradient(colors)
else
error("Invalid direction '" .. tostring(direction) "' for gradient. Horizontal or vertical expected.")
end
local result = love.image.newImageData(direction and 1 or #colors, direction and #colors or 1)
local result = love.image.newImageData(direction and 1 or #colors, direction and #colors or 1,"rgba32f")
for __i, color in ipairs(colors) do
local x, y
if direction then
@@ -1,4 +1,4 @@
function gui:Center()
local x,y=self:getFullSize()
self:SetDualDim(-math.floor(x/2),-math.floor(y/2),nil,nil,.5,.5)
function gui:center()
self:centerX()
self:centerY()
end
@@ -6,4 +6,5 @@ function gui:Destroy()
table.remove(self.Parent.Children,cc)
end
end
self.Destroyed = true
end
@@ -2,9 +2,9 @@ function gui:getFullSize()
local maxx,maxy=-math.huge,-math.huge
local temp = self:GetAllChildren()
for i=1,#temp do
if temp[i].width>maxx then
if temp[i].width+temp[i].offset.pos.x>maxx then
maxx=temp[i].width+temp[i].offset.pos.x
elseif temp[i].height>maxy then
elseif temp[i].height+temp[i].offset.pos.y>maxy then
maxy=temp[i].height+temp[i].offset.pos.y
end
end
@@ -1,4 +1,4 @@
if love.filesystem.exists("CheckBoxes.png") then
if love.filesystem.getInfo("CheckBoxes.png") then
_GuiPro.UC=gui:getTile("CheckBoxes.png",0,0,16,16)
_GuiPro.C=gui:getTile("CheckBoxes.png",16,0,16,16)
_GuiPro.UCH=gui:getTile("CheckBoxes.png",0,16,16,16)
@@ -1,3 +1,7 @@
function gui:setNewFont(FontSize)
self.Font=love.graphics.setNewFont(tonumber(FontSize))
function gui:setNewFont(FontSize,filename)
if filename then
self.Font = love.graphics.newFont(filename, tonumber(FontSize))
else
self.Font=love.graphics.setNewFont(tonumber(FontSize))
end
end