love.graphics.print not printing to screen!

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.
dudeMan
Prole
Posts: 6
Joined: Mon Jun 04, 2018 7:02 am

love.graphics.print not printing to screen!

Post by dudeMan »

Well iv looked and looked and i'm hoping someone can help... Iv been loving playing around with love for the last couple of weeks, made the bones of a top down shooter that's working surprisingly well! A lot of that is due to this forum and all the great posts and wiki.
So onto my issue. everything is working great except for the love.graphics.print function will not print to my screen. Animations and physics no problem but a little bit of text, oh no can't do that! Driving me bonkers.
So far iv tried messing with all the variables I can think of. Figured the default font might not be working right so I tried setting the font to one I load with no luck and also tried creating a text object and drawing that directly with still no luck. I'm setting the color opposite the background and making sure to set the xy... I am completely lost and its the only thing holding me back from doing more with my game. I'm about ready to make a sprite sheet for all my text and make my own print function but that's a lot of work i don't want to do if I can avoid it.
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

Re: love.graphics.print not printing to screen!

Post by veethree »

If you post your code we can help you better
dudeMan
Prole
Posts: 6
Joined: Mon Jun 04, 2018 7:02 am

Re: love.graphics.print not printing to screen!

Post by dudeMan »

function love.load()
local font = love.graphics.newFont()
love.graphics.setFont( font ,144)
text = love.graphics.newText( font, 'textstring' )
end

function love.update(dt)
end

function love.draw()
love.graphics.setBackgroundColor( 1, 1, 1)
love.graphics.setColor(0, 0, 0)
love.graphics.draw(text, 25, 25)
love.graphics.print('some text' ,25, 25)
end

Not really doing anything fancy just will not show any text i try and draw.
Last edited by dudeMan on Mon Jun 04, 2018 4:13 pm, edited 1 time in total.
User avatar
veethree
Inner party member
Posts: 875
Joined: Sat Dec 10, 2011 7:18 pm

Re: love.graphics.print not printing to screen!

Post by veethree »

Is that the whole code? I don't see anything wrong with that.,
dudeMan
Prole
Posts: 6
Joined: Mon Jun 04, 2018 7:02 am

Re: love.graphics.print not printing to screen!

Post by dudeMan »

All I get with this code is a blank window
User avatar
DekuJuice
Prole
Posts: 14
Joined: Mon Nov 24, 2014 9:31 pm

Re: love.graphics.print not printing to screen!

Post by DekuJuice »

The code you posted works fine on both my desktop and my old thinkpad.
I noticed you're using the 0-1 color range, which was introduced in 11.0, but you're using a variant of setFont that was removed in 0.8.0. With the old 0-255 color range (0,0,0) text on a (1,1,1) background would be pretty much invisible. Make sure you're using the correct LOVE version.
Otherwise, this seems to be a driver issue if only text fails to render. Consider updating your graphics card drivers, and post specs so that we have some more information to work with.
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

Re: love.graphics.print not printing to screen!

Post by Beelz »

Sounds like you are having the same issue as me... https://bitbucket.org/rude/love/issues/ ... ken-in-v11

I haven't used LOVE since April because of it... I'm hoping 11.2 fixes it.

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
dudeMan
Prole
Posts: 6
Joined: Mon Jun 04, 2018 7:02 am

Re: love.graphics.print not printing to screen!

Post by dudeMan »

yeah... that seems to be my exact issue. I went ahead and loaded love onto my laptop and ran it and it printed just fine! Seems to be a system specific issue. Any thoughts on what if anything i can do to help find the issue?
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

Re: love.graphics.print not printing to screen!

Post by Beelz »

No clue TBH... I'm assuming it has to do with the graphics card, but I'm on the latest driver and haven't found any other solutions there either. If you figure it out I'd LOVE to know! ;)

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
dudeMan
Prole
Posts: 6
Joined: Mon Jun 04, 2018 7:02 am

Re: love.graphics.print not printing to screen!

Post by dudeMan »

Ok so just a quick update! My graphics card died, it was an older amd radeon card. Luckly I had a less beefy but newer nvidia card to replace it so had no downtime. I also noticed as soon as I got an error the next time messing with my game, that the text actully showed up on screen! So its definitely a graphics card issue.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 43 guests