I’m having the following problem: I noticed that when placing an object on-screen text that he has an offset top and bottom that prevents the placement sent by the designer
In the code example below I want to position the top of the text attached with the vertical line, but like you can see it not occured… the rectangle works like I expected
So I have painful work to fit the text manually as the specification of the designer
Can anyone help me with this?
[lua]display.setStatusBar( display.HiddenStatusBar )
HelveticaBold = “Helvetica-Bold”
Helvetica = “Helvetica”
local screenW, screenH = display.contentWidth, display.contentHeight
local centerW = screenW/2
local centerH = screenH/2
local main = function ()
local myCircle = display.newCircle( centerW, centerH, 5 )
myCircle:setFillColor(128,128,128)
local size = 100
local line1 = display.newLine( 0, screenH/2, screenW, screenH/2 )
line1:setColor( 255, 255, 255, 255 )
line1.width = 1
local line2 = display.newLine( screenW/2, 0, screenW/2, screenH )
line2:setColor( 100, 100, 100, 255 )
line2.width = 1
local text = display.newText(“aA”, 100, -5, HelveticaBold, size)
text:setReferencePoint(display.TopLeftReferencePoint)
text.x = centerW
text.y = centerH
local myRectangle = display.newRect(text.x, text.y, text.width, text.height)
myRectangle.alpha = 0.4
end
main()[/lua] [import]uid: 77276 topic_id: 15512 reply_id: 315512[/import]