Hi,
I’ve got a project with a simple main.lua (below) and a fonts folder with the Roboto font in bold, italic and regular. The loop in main.lua should create text objects with a font style corresponding to the input string. Unfortunately there is a mismatch, as in the picture below. There’s nothing coming up in the console, so I’m at a loss as to what the problem could be. I would appreciate any suggestions, thank you.
x
local fontStyles = {"regular", "bold", "italic"}
local function randomStyle()
return fontStyles[math.random(1,3)]
end
for i = 1, 9 do
local style = randomStyle()
local font = "fonts/Roboto-"..style
local text = display.newText({text = style, font = font, fontSize = 22})
text.anchorX = 0
text.y = i*30
end
Bug test.zip (229.1 KB)