love.graphics.print doesn't do anything

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.
Wscb
Prole
Posts: 10
Joined: Sun Apr 08, 2018 8:07 pm

love.graphics.print doesn't do anything

Post 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?
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post 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.
Wscb
Prole
Posts: 10
Joined: Sun Apr 08, 2018 8:07 pm

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

Post 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.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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.
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.
Wscb
Prole
Posts: 10
Joined: Sun Apr 08, 2018 8:07 pm

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

Post 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.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post by zorg »

What happens when you try just this:?

Code: Select all

function love.draw()
  love.graphics.print("Hello World!", 0, 0)
end
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.
Wscb
Prole
Posts: 10
Joined: Sun Apr 08, 2018 8:07 pm

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

Post by Wscb »

I copy pasted it. A black window opens.

Oh, I forgot to mention, I do have version 11.0.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

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

Post 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.
drunken_munki
Party member
Posts: 134
Joined: Tue Mar 29, 2011 11:05 pm

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

Post 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.
User avatar
zorg
Party member
Posts: 3444
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

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

Post 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...
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.
Post Reply

Who is online

Users browsing this forum: No registered users and 223 guests