ContentScale changes in new release?

Hi - I have a problem displaying native text - in specific sizes that adjust depend on the type of iOS device used (due to the various screen resolutions).  I store display.contentScaleX and then use it to display text at the appropriate size based on the device screen res using:  

credits_title.size=50/scalex 

The actual order of syntax is a generic display.newText, followed by setting the colours, and then the size using the command above, followed by setReferencePoint (if needed) for positioning on screen, followed by X and Y setting.

This all worked brilliantly on build 971 - and the text would always appear correct size / position.  However…

I have just installed build 1076 - and now my text appears huge (running on iPad 3).  

So, what has changed between these builds that is likely to change these font sizes???

I’d rather find out the actual reason before I go back and started manually tweaking sizes to make them fit, and retest on all the different device types again (physical device tests, as the results are different to just in the simulator).

The full example code would be:

    credits_title   = display.newText(“Credits”,0,0,native.systemFont,1)

    credits_title:setTextColor(255,255,255)

    credits_title.size=50/scalex 

    credits_title:setReferencePoint(display.CenterLeftReferencePoint)        

    credits_title.x = _W*0.40    credits_title.y = _H*0.10    – _W - contentWidth,  _H - contentHeight

Regards,

Dave.

Here’s a screenshot of the two releases, to show the problem encountered…

Exactly the same code.

display.newText automatically scales based on the device.  You do not need to scale it.   There may have been a bug between 971 and now that created problems on the iPad, but generally you do not need to scale your text… for display.newText, however if you are using native.newTextField or native.newTextBox those have to be scaled as they do not support device scaling.

Thanks Rob - I removed the scaling component, but there’s still something worth considering.

I was using scalex = display.contentScaleX, and via the terminal / simulator it was showing as being the value 1 (so I thought it would make no difference when I built it on a device.  However, on the device, the font size was still big.

However, when I hardcode my scalex variable to actually by just the value 1 - everything is fine.

This would imply that (possibly) display.contentScaleX has a different value actually on a device which is different to what it shows for the simulator for THAT device.  May just be worth your dev guys being aware of… :slight_smile:

Thanks again for the top assistance.  My app is now ready to go!!!

Here’s a screenshot of the two releases, to show the problem encountered…

Exactly the same code.

display.newText automatically scales based on the device.  You do not need to scale it.   There may have been a bug between 971 and now that created problems on the iPad, but generally you do not need to scale your text… for display.newText, however if you are using native.newTextField or native.newTextBox those have to be scaled as they do not support device scaling.

Thanks Rob - I removed the scaling component, but there’s still something worth considering.

I was using scalex = display.contentScaleX, and via the terminal / simulator it was showing as being the value 1 (so I thought it would make no difference when I built it on a device.  However, on the device, the font size was still big.

However, when I hardcode my scalex variable to actually by just the value 1 - everything is fine.

This would imply that (possibly) display.contentScaleX has a different value actually on a device which is different to what it shows for the simulator for THAT device.  May just be worth your dev guys being aware of… :slight_smile:

Thanks again for the top assistance.  My app is now ready to go!!!