Hi guys,
After creating a newText(), i tried to check its font size using “.size”, but the returned value isn’t what I set.
The documents says it can retrieve or set the font size, where i can successfully set the font size. (http://docs.coronalabs.com/api/type/TextObject/size.html)
From the codes below, setting the font size to 40 will print out " 26.666667938232".
But if I explicitly add this additional code, “myText.size = 40”, it will correctly return “40”.
Am I missing something ?
local myText = display.newText( "Hello, World!", 0, 0, native.systemFont, 40 ) myText.x = display.contentWidth / 2 myText.y = display.contentWidth / 4 myText:setTextColor( 255,110,110 ) print( "myText.size : " , myText.size )