So I was following a tutorial where with some function a text on the menu screen changes its color if you move your mouse over it, I was copying the code but when I run the project it just didn't work, and I can't found whats wrong with the code, even looking in others tutorials.
Here is the .love file.
[Solved]The text doesn't react to te mouse when it's over it
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[Solved]The text doesn't react to te mouse when it's over it
Last edited by Aik on Wed Nov 18, 2015 7:59 pm, edited 1 time in total.
- HugoBDesigner
- Party member
- Posts: 403
- Joined: Mon Feb 24, 2014 6:54 pm
- Location: Above the Pocket Dimension
- Contact:
Re: The text doesn't react to te mouse when it's over it
You've got a typo on line 15 of menu.lua. It's 'mouseover', not 'mousever'
Also, to make it properly work, you'll need to add 'v.mouseover = false' on the first line of the for block, on line 40, like so:
Also, to make it properly work, you'll need to add 'v.mouseover = false' on the first line of the for block, on line 40, like so:
Code: Select all
for i,v in ipairs (button) do
v.mouseover = false
if mouse_x > v.x and
mouse_x < v.x + medium:getWidth(v.text) and
mouse_y > v.y and
mouse_y < v.y + medium:getHeight() then
v.mouseover = true
end
end
Re: The text doesn't react to te mouse when it's over it
Thank you! now it works perfectly.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests