Ok it worksI know why: the folder is named "Dark", while the code refers to "dark". Capitalization matters! Renaming it makes it work in .loves and on Linux/Mac.
I mean my post,edited somethingWhere?
Ok it worksI know why: the folder is named "Dark", while the code refers to "dark". Capitalization matters! Renaming it makes it work in .loves and on Linux/Mac.
I mean my post,edited somethingWhere?
Code: Select all
function goo.object:destroy()
if self.parent then
for k,v in pairs(self.parent.children) do
if v == self then table.remove(self.parent.children,k) end
end
end
for i,child in ipairs(self.children) do
child:destroy()
end
self = nil
return
end
Code: Select all
function goo.object:destroy()
if self.parent then
for k,v in pairs(self.parent.children) do
if v == self then
table.remove(self.parent.children,k)
for i = self.z, #self.parent.children do
self.parent.children[i].z = i
end
end
end
end
for i,child in ipairs(self.children) do
child:destroy()
end
self = nil
return
end
Code: Select all
function PerkList[i].button:onClick ()
if PerkList[i].hasit == 0 then
if Points => PerkList[i].cost then
Points = Points - PerkList[i].cost
PerkList[i].hasit = 1
end
elseif PerkList[i].hasit == 1 then
Points = Points + PerkList[i].cost
PerkList[i].hasit = 0
end
panel:setTitle( "Traits ( You have ".. Points.." points to spend)" )
end
whitebear wrote:The function doesn't like having in it's call. Is there some way to do this without causing an error?
Code: Select all
PerkList[i].button.onClick = function (self)
if PerkList[i].hasit == 0 then
if Points => PerkList[i].cost then
Points = Points - PerkList[i].cost
PerkList[i].hasit = 1
end
elseif PerkList[i].hasit == 1 then
Points = Points + PerkList[i].cost
PerkList[i].hasit = 0
end
panel:setTitle( "Traits ( You have ".. Points.." points to spend)" )
end
My version works,but its for 0.7whitebear wrote:This is one of the best gui's out there but has anyone gotten the goo.text working? because either the code has bug or it's done differently from goo.textinput
There is no simple text object in example so it's possible it was missed in beta testing.
Code: Select all
-- STATIC TEXT
goo.text = class('goo static text', goo.object)
function goo.text:initialize( parent )
super.initialize(self,parent)
self.text = "no text"
end
function goo.text:draw(x,y)
love.graphics.setColor( unpack(self.color) )
love.graphics.print( self.text, x, y )
end
function goo.text:setText( text )
self.text = text or ""
end
function goo.text:getText()
return self.text
end
return goo.text
Code: Select all
-- STATIC TEXT
goo.text = class('goo static text', goo.object)
function goo.text:initialize( parent )
super.initialize(self,parent)
self.text = "no text"
self.color = {0,0,0,255}
end
function goo.text:draw()
love.graphics.setColor( unpack(self.color) )
love.graphics.print( self.text, self.x, self.y )
end
function goo.text:setText( text )
self.text = text or ''
end
function goo.text:getText()
return self.text
end
return goo.text
Code: Select all
function goo.base:getAbsoluteSize() return 0,0 end
function goo.object:getAbsoluteSize( w, h )
local w, h = w or self.w, h or self.h
return (w*self.parent.xscale), (h*self.parent.yscale)
Users browsing this forum: No registered users and 7 guests