having issue with display.newText

i’m getting this in the terminal

WARNING: Due to system limitations, display.newText() height is going to be increased to nearest multiple of 4: 1843 ===> 1844.
 

im using build 1135

heres my config.lua

[lua]

    local aspectRatio = display.pixelHeight/display.pixelWidth

    application =
    {
        content =
        {
            width = 320 * (aspectRatio>1.5 and 1 or 1.5/aspectRatio),
            height = 480 * (aspectRatio<1.5 and 1 or aspectRatio/1.5),
            scale = “letterbox”,

            imageSuffix =
            {
                ["@2x"] = 1.5,
                ["@4x"] = 3.0,
            },
        },
    }

[/lua]

and here’s how i tried to correct then problem

where var.displayLength is set to contentHeight - 50px

[lua]

var.displayLength = var.displayLength+(var.displayLength%4)
      print("__"…var.displayLength)
      appText = display.newText( appLogGroup, “”, _api.oriX, _api.oriY+20, _api.cntW-_api.oriX, var.displayLength, native.systemFontBold, 12*var.scale )
[/lua]

now this works fine in sim on iphone,iphone4,iphone5 but i get the warning on most other devices

using the above config.lua file and this code below you can try it in the various sims and check the terminal

[lua]

local _w = display.contentWidth

local _h = display.contentHeight

local _x = display.screenOriginX

local _y = display.screenOriginY

local textHeight = ((_h - _y) - 50)

print("textHeight = "…textHeight)

textHeight = textHeight + (4 - textHeight%4)

print("new textHeight = "…textHeight)

local txt = display.newText( “”, _x, _y+20, _w-_x, textHeight, native.systemFontBold, 12 )
[/lua]

happens in 1195 also

it seems as if some devices in the sim are not using content scaling for newText

Because text renders to an OpenGL texture, things divisible by 4 are common place (like masks).   I think this is a mostly harmless warning.  If you set a text box width of 199, it’s going to make the box 200 and spew that error.  Those extra 1-3 pixels will rarely be hit the way things wrap, so it shouldn’t impact your UI design that much.   Brent sent a message to the engineers earlier today to make sure.

Thx rob
But I have to determine how big to make the text box for multiple devices using multiple orientations and at times the box needs to be recreated over and over. And I can’t figure out how to calculate the size I need to make the box so this doesn’t happen.
I can send you the code to look at if you want. It’s too big to post it’s almost 1000 lines of code

I think you can just ignore the warning and go on.  I’m not sure how you’re setting the size now.  But in my apps, I just you whatever size I want and let Corona deal with rounding it up to the next divisible by 4 number.

I’m fine with that but read that it causes a slight delay. Although I haven’t noticed one the code is for a module that others will use so not sure if it will cause a delay in their code.

just double checked my code the text box is only created once the warning is displayed every time the text is updated

happens in 1195 also

it seems as if some devices in the sim are not using content scaling for newText

Because text renders to an OpenGL texture, things divisible by 4 are common place (like masks).   I think this is a mostly harmless warning.  If you set a text box width of 199, it’s going to make the box 200 and spew that error.  Those extra 1-3 pixels will rarely be hit the way things wrap, so it shouldn’t impact your UI design that much.   Brent sent a message to the engineers earlier today to make sure.

Thx rob
But I have to determine how big to make the text box for multiple devices using multiple orientations and at times the box needs to be recreated over and over. And I can’t figure out how to calculate the size I need to make the box so this doesn’t happen.
I can send you the code to look at if you want. It’s too big to post it’s almost 1000 lines of code

I think you can just ignore the warning and go on.  I’m not sure how you’re setting the size now.  But in my apps, I just you whatever size I want and let Corona deal with rounding it up to the next divisible by 4 number.

I’m fine with that but read that it causes a slight delay. Although I haven’t noticed one the code is for a module that others will use so not sure if it will cause a delay in their code.

just double checked my code the text box is only created once the warning is displayed every time the text is updated