I changed this. Thanks for your help.pedrosgali wrote: ↑Wed Oct 17, 2018 6:26 pm The main.lua file should look like this:Well I'm sure there will be other things in there but that's the minimum you need to get your code working. Once you do your positioning is off You're drawing a box 400 wide with the text but checking a box 200 wide for clicks.Code: Select all
local menu = require "menu" function love.load() menu_load() end function love.mousepressed(x, y, b) menu_mousepressed(x, y, b) end function love.update(dt) end function love.draw() menu_draw() end
Mousepressed not working?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Mousepressed not working?
-
- Party member
- Posts: 107
- Joined: Wed Oct 15, 2014 5:00 pm
- Location: Yorkshire, England
Re: Mousepressed not working?
No problem, next time if you post a .love file like I did it'll be a lot easier to help you as all the code will be there for us to look at.
Code: Select all
if not wearTheseGlasses() then
chewing_on_trashcan = true
end
Re: Mousepressed not working?
Forgive my noobiness, how do I change my seperate lua files into a .love file?pedrosgali wrote: ↑Wed Oct 17, 2018 6:39 pm No problem, next time if you post a .love file like I did it'll be a lot easier to help you as all the code will be there for us to look at.
-
- Party member
- Posts: 107
- Joined: Wed Oct 15, 2014 5:00 pm
- Location: Yorkshire, England
Re: Mousepressed not working?
just zip them up and rename from .zip to .love
Code: Select all
if not wearTheseGlasses() then
chewing_on_trashcan = true
end
Re: Mousepressed not working?
There it is. A .love file of my project with the directories that it uses. I have tested it on my PC and it works exactly the same as it would in my IDE. So the buttons don't actually seem to print anything.
- Attachments
-
- Project.love
- (49.59 KiB) Downloaded 132 times
-
- Prole
- Posts: 10
- Joined: Sun Jun 25, 2017 5:29 pm
Re: Mousepressed not working?
In your main.lua you have "love.mouspressed" it should be "love.mousepressed" you were missing an ("e").
Re: Mousepressed not working?
It's not about what I need to hear. It's about offering the code for us to look. As pedrosgali has demonstrated, the issue is not in main.lua or in the snippet you have pasted, therefore if you want us to help, we need to look elsewhere. But we can't unless we have enough code to allow us to reproduce the problem.xpali2 wrote: ↑Wed Oct 17, 2018 6:14 pm I'll tell you it's just as frustrating on my end. If I am not giving you something you think you need to see to solve the issue then ask away, I am not an experienced coder so I can't guess what you need to hear. I have to say that I don't get what you mean with "two mousepressed events" if you could explain. I have checked the console many times by putting a print outside of the basic callbacks in main.lua that print to the console I am viewing: https://ibb.co/f6LEaf. I have tried "LoveMousepressed = love.mousepressed" but nothing changes, no errors or anything. Btw, mousemoved does work, so I reckon the mouse isn't the problem, meaning the mouse module is also not the issue.
Edit: It seems you have provided the code and mastermarkus has identified the problem.
Re: Mousepressed not working?
Ah, I am a real idiot... Thanks and sorry for wasting your time to all.mastermarkus wrote: ↑Wed Oct 17, 2018 8:39 pm In your main.lua you have "love.mouspressed" it should be "love.mousepressed" you were missing an ("e").
Who is online
Users browsing this forum: Amazon [Bot], Google [Bot] and 9 guests