Hi community I'm facing a simple problem that I can't seem to find out. Ok the problem is in my main menu theres level to select. In each level i put 1, 2, 3... on each level using display.newText. When I build for my device the text would not show but the game would run perfectly fine. The text does show in the simulator but not on the real device what could be?
Also I'm using Build 704
A quick guess would be to make sure that the font you are trying to use is supported on the device. An easy way to test this is to pass the constant native.systemFont to the display.newText function instead of the font you are currently using.
I use the following error checking logic to validate font names:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| function CreateFont( font_name, size )
local available_fonts = native.getFontNames()
local font_found = false
for index,font in pairs(available_fonts) do
if font == font_name then
font_found = true
break
end
end
if not font_found then
font_name = native.systemFont
print("### SCRIPT ERROR ### font: " .. font_name .. " not found, using native.systemFont instead!")
end
local my_font = display.newText("",0,0,font_name, size)
return my_font
end |
Licensing
your actually right because when I was testing on my IOS using font "Arial Black" it did not show. So instead I switch to "Arial" and it worked thanks for help
:)