love.graphics.print troubles
Posted: Wed Nov 18, 2020 7:39 am
Hi all,
Having a strange problem printing variables to screen using love.graphics.print.
I want to print the current screen resolution to the screen in the settings menu,
I am getting the variables with the following
local resolutionw = love.graphics.getWidth()
local resolutionh = love.graphics.getHeight()
and am trying to print it to screen with
love.graphics.print(tostring(resolutionw)..' x '..tostring(resolutionh), WINDOW_WIDTH / 3 + BUTTON_WIDTH / 2 + margin, WINDOW_HEIGHT / 3 + (BUTTON_HEIGHT / 2 + margin) * 2)
however all I am getting is
' x '
however, just above it
local fscreen = love.window.getFullscreen()
love.graphics.print(tostring(fscreen), WINDOW_WIDTH / 3 + BUTTON_WIDTH / 2 + margin, WINDOW_HEIGHT / 3 + (BUTTON_HEIGHT / 2 + margin))
works just fine.
Printing normal text to the screen works just fine as well. It seems to be just variables.
If I start a clean project these work just fine.
If someone has ran into the same troubles, please point me in the direction of fixing it.
Having a strange problem printing variables to screen using love.graphics.print.
I want to print the current screen resolution to the screen in the settings menu,
I am getting the variables with the following
local resolutionw = love.graphics.getWidth()
local resolutionh = love.graphics.getHeight()
and am trying to print it to screen with
love.graphics.print(tostring(resolutionw)..' x '..tostring(resolutionh), WINDOW_WIDTH / 3 + BUTTON_WIDTH / 2 + margin, WINDOW_HEIGHT / 3 + (BUTTON_HEIGHT / 2 + margin) * 2)
however all I am getting is
' x '
however, just above it
local fscreen = love.window.getFullscreen()
love.graphics.print(tostring(fscreen), WINDOW_WIDTH / 3 + BUTTON_WIDTH / 2 + margin, WINDOW_HEIGHT / 3 + (BUTTON_HEIGHT / 2 + margin))
works just fine.
Printing normal text to the screen works just fine as well. It seems to be just variables.
If I start a clean project these work just fine.
If someone has ran into the same troubles, please point me in the direction of fixing it.