labelYOffset different on simulator from device

I’m noticing that on some buttons (specifically those included within scroll views but also in some other places), the vertical alignment of a widget button’s text is different by around 3 or 4 pixels in the simulator and the device.

On an iPad, the text looks way too low in the button when it is perfectly centred in the simulator.

Has anyone else come across this / a solution / reason…?

Thanks in advance for any help.

Cheers,

Ian

Corona SDK’s display.newText() function (which widget.newButton() uses) is dependent on the Operating System’s built in text handling to generate the graphic texture we use. Android, iOS, OS-X and Windows all handle fonts a little bit differently. This is why it’s important to test on devices.

Rob

Hi Rob,

Thanks for the response. The weird thing though is that within the same environment, some buttons are behaving differently to others.

Those in widget scrollviews for example have their label several pixels lower than those outside scrollviews.

Any idea why that may be happening? I can test for it and correct but if buttons behave differently across platforms and within the same platform then it make for a lot of what ifs.

Thanks,

Ian

Corona SDK’s display.newText() function (which widget.newButton() uses) is dependent on the Operating System’s built in text handling to generate the graphic texture we use. Android, iOS, OS-X and Windows all handle fonts a little bit differently. This is why it’s important to test on devices.

Rob

Hi Rob,

Thanks for the response. The weird thing though is that within the same environment, some buttons are behaving differently to others.

Those in widget scrollviews for example have their label several pixels lower than those outside scrollviews.

Any idea why that may be happening? I can test for it and correct but if buttons behave differently across platforms and within the same platform then it make for a lot of what ifs.

Thanks,

Ian