mousepressed and print

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Firus
Prole
Posts: 5
Joined: Sat Aug 27, 2016 1:39 pm

mousepressed and print

Post by Firus »

well, it sounds idiot, but i have this problem here in my main.lua file:

Code: Select all

function love.mousepressed(x, y, button, istouch)
	print( x .. " " .. y)
end

function love.draw()
	love.graphics.print("Hello", 100, 200)
end
I'm using love 0.10 and Lua 5.3, on Windows 10...
the print isn't working, i belived that the love.mousepressed() is not be triggered. Thanks for help!
User avatar
rok
Prole
Posts: 36
Joined: Wed Dec 24, 2014 9:12 am
Location: Slovenia

Re: mousepressed and print

Post by rok »

Works great on 0.10.1 on Linux.

Did you run the game via the console to see the output?
User avatar
zorg
Party member
Posts: 3451
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: mousepressed and print

Post by zorg »

First thing's first, the fact that you might have Lua 5.3 on your OS does not change the fact that by default, löve uses luaJIT.

As for your issue, since print prints to the console, did you enable it in conf.lua?
Because without that, it won't work.

If it still doesn't work, then it's either because you're using an IDE like zerobrane, or you're trying to run your project from a text editor like sublimetext, that swallow the console output. Or it might be a win10 issue; solutions to that will come with the next version.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: mousepressed and print

Post by raidho36 »

I believe "print" is supposed to print to console, so if you don't have one opened nothing will happen.
Attachments
Screenshot from 2016-08-27 22-46-13.png
Screenshot from 2016-08-27 22-46-13.png (125.77 KiB) Viewed 4253 times
Firus
Prole
Posts: 5
Joined: Sat Aug 27, 2016 1:39 pm

Re: mousepressed and print

Post by Firus »

I'm running at the prompt and nothing is show on the console. Conf.lua doesn't help...
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: mousepressed and print

Post by raidho36 »

Not sure I know what's going on. As an intermediate solution, you can define "print" to output information directly on the game screen as an overlay.
Firus
Prole
Posts: 5
Joined: Sat Aug 27, 2016 1:39 pm

Re: mousepressed and print

Post by Firus »

Ops, my bad. i'm worng... Zorg is right i had to add

Code: Select all

function love.conf(t)
	t.console = true
end
and it's worked proprely... Thanks again.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests