Page 1 of 1

loveframes OnClick not working

Posted: Mon Dec 14, 2015 9:23 am
by Buby
Hey guys! I was recently using loveframes and found out that the OnClick function does not work is there a fix?

Code: Select all

loveframes = require("assets.Source")
StartP = 0
loveframes.SetState("Menu")
local button = loveframes.Create("button")
button:SetState("Menu")
button:SetSize(love.window.getWidth() / 8, love.window.getHeight() / 27)
button:SetText("Play!")
button:Center()
button.OnClick = function(object)
StartP = 1 
end
It works when i do OnMouseEnter but not OnClick which i find weird please help!

-Note this is not the complete script I just sliced it to add the important bits
-I have already added all the loveframes. functions including mousepressed and mousereleased

Re: loveframes OnClick not working

Posted: Mon Dec 14, 2015 8:54 pm
by Nikolai Resokav
The code you posted seems like should work, so I'm not quite sure what the problem is without more info. Can you post a .love of your project please? You could also send it to me in a pm if you aren't comfortable with posting it on the forums.

Re: loveframes OnClick not working

Posted: Tue Dec 15, 2015 3:20 am
by bobbyjones
Did you set the loveframes callbacks?