Page 1 of 2

love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 8:38 pm
by Wscb
Hi, I'm new here. I just downloaded love2d a few days ago and started trying it out today, but I've already run into a problem! I have this code:

Code: Select all

function love.draw()
  love.graphics.rectangle("fill", 10, 10, 10, 10)
  love.graphics.print("Current FPS: "..tostring(love.timer.getFPS( )), 20, 10)
  love.graphics.print("Hello World!", 400, 300)
end
in my main.lua and the print functions do nothing.
I tried to do a simple "Hello World!" program first and it gave me a black screen only. Then I added the line with the fps and in the end I added the love.graphics.rectangle function which actually gets drawn correctly.

So this code only gives me a 10x10 rectangle and nothing else... Does anyone know what's wrong?

And since you're here, would you link any tutorials that you like?

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 9:36 pm
by raidho36
Well all I can say is that it works for me. There might be an issue with your graphics driver or something. If you have high DPI mode enabled, try turning it off and see if it does anything.

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 9:50 pm
by Wscb
I don't know what that is. Is it enabled by default? I haven't touched it. Where can I see if it's enabled?

My OS is windows, by the way, and I installed love2d with the 64-bit installer.

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 9:56 pm
by zorg
Windows what, XP? Vista? 7? 8? 8.1? 10?
Also, i'm assuming you got the newest Löve version, right? 11.0?
Look at Config_Files, create a conf.lua (which by default has t.window.highdpi = false) next to your main.lua, and test with that.
Also, knowing what kind of graphics card you have would be informative as well.

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 10:14 pm
by Wscb
Windows 10. My graphics card is ati radeon hd 4600 series.

I created a conf.lua with this code:

Code: Select all

function love.conf(t)
  t.window.highdpi = false
end
That's what you meant, right?
I still get the same behaviour.

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 10:16 pm
by zorg
What happens when you try just this:?

Code: Select all

function love.draw()
  love.graphics.print("Hello World!", 0, 0)
end

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 10:19 pm
by Wscb
I copy pasted it. A black window opens.

Oh, I forgot to mention, I do have version 11.0.

Re: love.graphics.print doesn't do anything

Posted: Sun Apr 08, 2018 11:20 pm
by raidho36
I meant the OS setting. I don't use Windows so I have no idea where it is, I do however know that Windows doesn't play nice with it and you should basically leave it at "no scaling" at all times. Try upgrading your graphics driver, too.

Re: love.graphics.print doesn't do anything

Posted: Mon Apr 09, 2018 3:38 am
by drunken_munki
Wscb wrote: Sun Apr 08, 2018 10:14 pm My graphics card is ati radeon hd 4600 series.
That g-card supports OpenGL 2.0.

As far as I am aware Love requires opengl 3.0, perhaps 3.3 for version 11.0 of Love.

Re: love.graphics.print doesn't do anything

Posted: Mon Apr 09, 2018 5:01 am
by zorg
drunken_munki wrote: Mon Apr 09, 2018 3:38 am
Wscb wrote: Sun Apr 08, 2018 10:14 pm My graphics card is ati radeon hd 4600 series.
That g-card supports OpenGL 2.0.

As far as I am aware Love requires opengl 3.0, perhaps 3.3 for version 11.0 of Love.
Nope, it can use that if it detects it, but otherwise it will fall back to 2.1... i think? In which case, the card may still not be fully supported, due to only having 2.0...