Version 0.9.4.15 - Alpha (see changelog.txt)

This commit is contained in:
Kenny Shields 2013-01-05 11:34:54 -05:00
parent 7c8df81518
commit 2fc9df1deb
5 changed files with 46 additions and 5 deletions

View File

@ -1,3 +1,9 @@
================================================
Version 0.9.4.15 - Alpha (January 5 - 2013)
================================================
[ADDED] a new base method: GetInternals()
[ADDED] a new tooltip method: SetFollowObject(bool)
================================================
Version 0.9.4.14 - Alpha (January 4 - 2013)
================================================

View File

@ -9,7 +9,7 @@ loveframes = {}
-- library info
loveframes.info = {}
loveframes.info.author = "Kenny Shields"
loveframes.info.version = "0.9.4.14"
loveframes.info.version = "0.9.4.15"
loveframes.info.stage = "Alpha"
-- library configurations

View File

@ -756,6 +756,21 @@ function newobject:GetChildren()
end
--[[---------------------------------------------------------
- func: GetInternals()
- desc: returns the object's internals
--]]---------------------------------------------------------
function newobject:GetChildren()
local internals = self.internals
if internals then
return internals
end
end
--[[---------------------------------------------------------
- func: IsTopList()
- desc: returns true if the object is the top most list
@ -975,9 +990,11 @@ end
--]]---------------------------------------------------------
function newobject:IsTopInternal()
local internals = self.parent.internals
local parent = self.parent
local internals = parent.internals
local topitem = internals[#internals]
if internals[#internals] ~= self then
if topitem ~= self then
return false
else
return true

View File

@ -30,7 +30,8 @@ function newobject:initialize(parent, text, tabnumber, tip, image, onopened, onc
if tip then
self.tooltip = loveframes.objects["tooltip"]:new(self, tip)
self.tooltip:SetFollowCursor(false)
self.tooltip:SetOffsets(0, -5)
self.tooltip:SetFollowObject(true)
self.tooltip:SetOffsets(0, -(self.tooltip.text:GetHeight() + 12))
end
if image then

View File

@ -25,6 +25,7 @@ function newobject:initialize(object, text, width)
self.internal = true
self.show = false
self.followcursor = true
self.followobject = false
self.alwaysupdate = true
-- create the object's text
@ -78,10 +79,15 @@ function newobject:update(dt)
self.visible = ovisible
if ohover and ovisible then
local top = self:IsTopInternal()
if self.followcursor then
local followcursor = self.followcursor
local followobject = self.followobject
if followcursor then
local x, y = love.mouse.getPosition()
self.x = x + self.xoffset
self.y = y - self.height + self.yoffset
elseif followobject then
self.x = object.x + self.xoffset
self.y = object.y + self.yoffset
end
if not top then
self:MoveToTop()
@ -216,4 +222,15 @@ function newobject:SetFont(font)
self.text:SetFont(font)
end
--[[---------------------------------------------------------
- func: SetFollowObject(bool)
- desc: sets whether or not the tooltip should follow
it's assigned object
--]]---------------------------------------------------------
function newobject:SetFollowObject(bool)
self.followobject = bool
end