[Resolved] How to adjust Native TextField font size When Different Device is Used?

@mpappas I tried what you said about contentScaleY or X, the problem when i tried to change the device size is that? when i am in iPad the ScaleY is 0.4356 or something like that, but when i tried the iPhone its 1 and the Droid is 44 so doing this

local systemfont = display.contentScaleY / 5  

will not work when changing a screen size. Can you help me figure this one out? [import]uid: 189861 topic_id: 33338 reply_id: 132854[/import]

@wwwdotphilip - you are getting closer.

the code should look more like

 local fontSize = 24 / display.contentScaleY  
 -- use fontSize as the font size in your native field...  

[import]uid: 79933 topic_id: 33338 reply_id: 132856[/import]

Well that make sense. Thanks for correcting me sir, didn’t notice I just have to reverse the values. Thank you sir. :slight_smile: [import]uid: 189861 topic_id: 33338 reply_id: 132859[/import]

The font size (24 above) should be pretty close to the normal font sizes you use as well.

Peach’s observation above is correct. The NATIVE FIELD font size is directly tied to the NATIVE DEVICE RESOLUTION, so the compensation shown above (factoring by the device contentScale) is necessary at runtime… Native things have a way of working out in native ways (including defying depth priorities, etc)…

Best wishes. [import]uid: 79933 topic_id: 33338 reply_id: 132861[/import]

Apologies on the late reply, I wasn’t working this AM - thanks mpappas, wonderful explanation :slight_smile:

wwwdotphilip - good luck with your project! [import]uid: 52491 topic_id: 33338 reply_id: 132971[/import]

@Peach Thank you… :slight_smile: [import]uid: 189861 topic_id: 33338 reply_id: 133417[/import]

@Peach Thank you… :slight_smile: [import]uid: 189861 topic_id: 33338 reply_id: 133417[/import]