Native display objects fonts don’t scale like all the other Corona scaling does. If you’re on a retina iPad you will need to double the font size for native objects over a regular iPad or iPad mini. Likewise if you’re stating on a 3Gs at 320x480, those fonts will need to be bigger on the iPad or the retina phones.
You can use display.contentHeight and display.pixelHeight to compute a scale factor and multiple your font’s for native objects by that value:
local myFontSize = 16
local scale = display.pixelHeight / display.contentHeight
myTextField = native.newTextField(0,0,100,20)
myTextField.size = myFontSize \* scale
Or something like that to get you started.
[import]uid: 199310 topic_id: 37380 reply_id: 145596[/import]
Rob,
I *think* there may be some confusion here. He’s talking about using native.systemFont in a regular display object created with display.newText. Your example is creating an actual native displayObject which I thought followed a different set of rules (but I could be wrong)
hopefully I’m not confusing the issue even more [import]uid: 32462 topic_id: 37380 reply_id: 145601[/import]
Just as a quick test, can you take out the line where you specify .size as 30? I seem to recall that I had an issue with that recently (could be a bug), and I intended to follow up and investigate but it got buried under a dozen other priorities.
In any case, I never use that command, I always set my font size in the main API call.
Native display objects fonts don’t scale like all the other Corona scaling does. If you’re on a retina iPad you will need to double the font size for native objects over a regular iPad or iPad mini. Likewise if you’re stating on a 3Gs at 320x480, those fonts will need to be bigger on the iPad or the retina phones.
You can use display.contentHeight and display.pixelHeight to compute a scale factor and multiple your font’s for native objects by that value:
local myFontSize = 16
local scale = display.pixelHeight / display.contentHeight
myTextField = native.newTextField(0,0,100,20)
myTextField.size = myFontSize \* scale
Or something like that to get you started.
[import]uid: 199310 topic_id: 37380 reply_id: 145596[/import]
Rob,
I *think* there may be some confusion here. He’s talking about using native.systemFont in a regular display object created with display.newText. Your example is creating an actual native displayObject which I thought followed a different set of rules (but I could be wrong)
hopefully I’m not confusing the issue even more [import]uid: 32462 topic_id: 37380 reply_id: 145601[/import]
Just as a quick test, can you take out the line where you specify .size as 30? I seem to recall that I had an issue with that recently (could be a bug), and I intended to follow up and investigate but it got buried under a dozen other priorities.
In any case, I never use that command, I always set my font size in the main API call.