Text not printed properly in android version
Posted: Sun Jul 04, 2021 5:54 pm
I have problems rendering text when I port my game to android (doesn't matter if I use the zip method or run it directly as a lovegame folder). Only some of the characters are displayed. This happens in any app I make, not just this one!
For the record, my android version is 6.0.1 and löve is updated to the last version.
UPDATE: I found a workaround. Creating a Text object instead of printing the string directly. Still, I would like an explanation. Does anybody knows why this happen? Am I always supposed to use Text objects instead of strings in löve?
Nope, that doesn't work either.
The guilty code looks like this:
This is how it is displayed in windows:
And this one is android:
What am I doing wrong?
For the record, my android version is 6.0.1 and löve is updated to the last version.
UPDATE: I found a workaround. Creating a Text object instead of printing the string directly. Still, I would like an explanation. Does anybody knows why this happen? Am I always supposed to use Text objects instead of strings in löve?
Nope, that doesn't work either.
The guilty code looks like this:
Code: Select all
function love.draw()
if text.show then
lg.setColor(0,0,0.05,0.9)
lg.rectangle("fill",text.x,text.y,text.w,text.h)
lg.setColor(1,1,1,1)
for i=1,#text.ls do
lg.print(text.ls[i],text.x+5,text.y+5+text.rowsep*(i-1))
end
end
if menu.show then
for i=1,#menu.opt do
lg.setColor(0,0,0.05,0.9)
local y= menu.y+(menu.h+5)*(i-1)
lg.rectangle("fill",menu.x,y,menu.w,menu.h)
lg.setColor(1,1,1,1)
lg.print(menu.opt[i],menu.tx,y+menu.ty)
end
end
end