neither the tooltips or the menus are working in this. i'm using love 0.9.0.
heres the code that creates the popup menu i want. it's called from love.mousepressed and moving this code to that function doesn't do anything
(that last line is for me, it prints a string on-screen. the string prints "menu x y" whenever i right-click, so i know all the code is being executed and the menu exists)
Code: Select all
function game.popup_menu(x, y)
if not loveframes.util.GetHoverObject() then
local bldgmenu = loveframes.Create("menu")
bldgmenu:AddOption("Details", false, function() end)
bldgmenu:AddOption("Demolish", false, function() end)
bldgmenu:SetPos(x, y):SetVisible(true)
util.add_debug_string(bldgmenu:GetType().." "..bldgmenu:GetX().." "..bldgmenu:GetY())
end
end
and here's the definition of my gui. that last tooltip i define for the 'elec' button never shows up when i hover over the elec button.
for the record the first part of the gui, all the way down to the tooltip, shows up and seems to function fine. its just these two elements im having problems with. thanks for any help anyone can provide.
Code: Select all
-- load the map and gui
function game.load()
loveframes.SetState("gamegui")
local sidebar = loveframes.Create("frame")
sidebar:SetName("CAnyon")
sidebar:SetSize(110, 600)
sidebar:SetState("gamegui")
sidebar:SetDraggable(false):ShowCloseButton(false):SetAlwaysOnTop(true)
local elec = loveframes.Create("button", sidebar):SetSize(20, 20):SetPos(5, 30):SetText("!")
local water = loveframes.Create("button", sidebar):SetSize(20, 20):SetPos(30, 30):SetText("W")
local weapons = loveframes.Create("button", sidebar):SetSize(20, 20):SetPos(55, 30):SetText(">")
local food = loveframes.Create("button", sidebar):SetSize(20, 20):SetPos(80, 30):SetText("F")
local elec_tooltip = loveframes.Create("tooltip")
elec_tooltip:SetObject(elec):SetText("Electric grid mapmode")
end