My game is currently released and running well under iOS and I’ve now been working on Android integration. The one weird problem I am seeing is that text using native.newTextField is so tiny it can’t be read…
My testing phone is a Samsung Galaxy S3 and everything else seems to be ok
I was not calling but that’s supposed to be the default behavior - the blog post mentions:
“The first of these functions (object:resizeFontToFitHeight()) is useful if you change the input field’s height sometime after the field is created, and you want to resize the font to fit within the field”
I just noticed you added to your comment - this testing is being done on the device, a Samsung Galaxy S3 - the screen shot I posted is grabbed directly from the device. On the simulator (and on every iOS device I have tested on) it does look ok.
Hi. I didn’t read the article, sorry. If it says that is the default behavior AND if the docs agree (may have changed since the blog), then you should file a bug.
If ‘resizeFontToFitHeight()’ didn’t work I’d make a small sample test case, verify it still fails to behave properly, then submit a bug.
Device versus Simuated - Yeah, I always edit after posting to clean up and add more thoughts. I like a nice clean post. Please note. The point I was making is you cannot depend on what you see in the simulator.
You’ll be asked for an example demonstrating the problem. It should have main.lua, config.lua, and a basic build.settings file. You will package this in a ZIP and attach it to the bug report.
If you do this, you may as well share a link to the zip file here too. That way others can test it and give feedback if they have time to help.
Cheers,
Ed
You should also consider posting a link to the test case here. It should have main.lua, config.lua, and a basic build.settings. It should also demonstrate just this problem. That way we are all sure we’re testing the same thing.
(Note: You’ll need this for your bug submission anyways.)
PS - I forgot to ask, but you’re using a current version of Corona right?
So I created a test project and of course found the issue almost right away - I believe it’s a bug since the goal of the changes from that blog post are to make the newTextField behave like display.newText on all devices
In config.lua if you set width and height to the default of 320x480 then it works as expected but if you set it to 640x960 (like I have with my project) then you get the problem where native.newTextField is half as big as the display.newText equivalent (but only on Android devices or at least the Samsung Galaxy S3 which is the only one I have to test on)
I take it that nobody sets their project to 640x960 otherwise this would be a more common issue. I set my project to 640x960 when I started working on it ages ago to get more granular placement of things - not sure if it makes any difference but to go back and change everything would be a huge pain!
I can code a workaround now at least - is this worth submitting a bug for?
You forgot to share a link to your sample. I’d love to look at it, before you file a bug.
I’m not convinced what I’m hearing is a bug. Note: You cant’ rely on the blog post as ‘it should work this way’, but rather on what the API docs say.
PS - I use 640x960 or larger as my primary size, but I don’t use text fields much.
PPS - Reading the first part of the article, I would agree with you that (even though I don’t see the same statements in the API docs after a quick look) this seems like a bug.
In the config.lua if you set width and height to 320x480 then it looks great on the Android device, if you set it to 640x960 it looks microscopic. On all iOS devices 320x480 and 640x960, the text size looks the exact same.
In my game I just check the device type and if it is Android I set the height in native.newTextField to double
I was not calling but that’s supposed to be the default behavior - the blog post mentions:
“The first of these functions (object:resizeFontToFitHeight()) is useful if you change the input field’s height sometime after the field is created, and you want to resize the font to fit within the field”
I just noticed you added to your comment - this testing is being done on the device, a Samsung Galaxy S3 - the screen shot I posted is grabbed directly from the device. On the simulator (and on every iOS device I have tested on) it does look ok.
Hi. I didn’t read the article, sorry. If it says that is the default behavior AND if the docs agree (may have changed since the blog), then you should file a bug.
If ‘resizeFontToFitHeight()’ didn’t work I’d make a small sample test case, verify it still fails to behave properly, then submit a bug.
Device versus Simuated - Yeah, I always edit after posting to clean up and add more thoughts. I like a nice clean post. Please note. The point I was making is you cannot depend on what you see in the simulator.
You’ll be asked for an example demonstrating the problem. It should have main.lua, config.lua, and a basic build.settings file. You will package this in a ZIP and attach it to the bug report.
If you do this, you may as well share a link to the zip file here too. That way others can test it and give feedback if they have time to help.
Cheers,
Ed
You should also consider posting a link to the test case here. It should have main.lua, config.lua, and a basic build.settings. It should also demonstrate just this problem. That way we are all sure we’re testing the same thing.
(Note: You’ll need this for your bug submission anyways.)
PS - I forgot to ask, but you’re using a current version of Corona right?
So I created a test project and of course found the issue almost right away - I believe it’s a bug since the goal of the changes from that blog post are to make the newTextField behave like display.newText on all devices
In config.lua if you set width and height to the default of 320x480 then it works as expected but if you set it to 640x960 (like I have with my project) then you get the problem where native.newTextField is half as big as the display.newText equivalent (but only on Android devices or at least the Samsung Galaxy S3 which is the only one I have to test on)
I take it that nobody sets their project to 640x960 otherwise this would be a more common issue. I set my project to 640x960 when I started working on it ages ago to get more granular placement of things - not sure if it makes any difference but to go back and change everything would be a huge pain!
I can code a workaround now at least - is this worth submitting a bug for?
You forgot to share a link to your sample. I’d love to look at it, before you file a bug.
I’m not convinced what I’m hearing is a bug. Note: You cant’ rely on the blog post as ‘it should work this way’, but rather on what the API docs say.
PS - I use 640x960 or larger as my primary size, but I don’t use text fields much.
PPS - Reading the first part of the article, I would agree with you that (even though I don’t see the same statements in the API docs after a quick look) this seems like a bug.
In the config.lua if you set width and height to 320x480 then it looks great on the Android device, if you set it to 640x960 it looks microscopic. On all iOS devices 320x480 and 640x960, the text size looks the exact same.
In my game I just check the device type and if it is Android I set the height in native.newTextField to double