I have a file called pong within that is main.lua and font.ttf and my program runs this code ->
mainFont = love.graphics.newFont('font.ttf', 9)
-- used to enter a new font style into memory for use
love.graphics.setFont(mainFont)
However, this gives me an error code, new to this so I have no clue what's wrong. Hope you can help?
Love2D could not open font.ttf. Does not exist
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Love2D could not open font.ttf. Does not exist
It has to be in the same folder as your main.lua file, because you didn't specify in which folder your font file is.
Re: Love2D could not open font.ttf. Does not exist
main.lua and font.ttf are within the same folder named 'pong'
Re: Love2D could not open font.ttf. Does not exist
Check the spelling because it looks for exact match.
Re: Love2D could not open font.ttf. Does not exist
Error
Could not open file font.ttf. Does not exist.
Traceback
[C]: at 0x7ffec5fcca30
[C]: in function 'newFont'
main.lua:14: in function 'load'
[C] in function 'xpcall'
[C] in function 'xpcall'
Re: Love2D could not open font.ttf. Does not exist
Is the file called 'font.ttf' exactly? Or is it like 'Font.ttf'?
Are you sure that the main.lua file you're running is the same that is in the same folder as the font?
There are also a few more things that could be wrong if you're using Windows, like having file extension visibility disabled and having the file called 'font.ttf.ttf'.
Are you sure that the main.lua file you're running is the same that is in the same folder as the font?
There are also a few more things that could be wrong if you're using Windows, like having file extension visibility disabled and having the file called 'font.ttf.ttf'.
Who is online
Users browsing this forum: Google [Bot] and 8 guests