Hello,
I suppose I am doing something wrong, but I have this problem.
In the following example, the letters are perfectly centered into the tile (which is a 62x31 png image).
local wordTile = display.newGroup();
local wordTileBackground = display.newImage(“tile.png”)
wordTile:insert(wordTileBackground)
local wordTileText = display.newText(wordTile,‘KA’, 0, 0, “Helvetica Neue”, 16 )
wordTileText:setReferencePoint( display.CenterReferencePoint )
wordTile:insert(wordTileText)
wordTileText.x,wordTileText.y = 31,11
wordTile.x,wordTile.y = 100,100
But if I use newImageRect, the text is no longer centered
local wordTile = display.newGroup();
local wordTileBackground = display.newImageRect(“tile.png”, 62, 31 )
wordTile:insert(wordTileBackground)
local wordTileText = display.newText(wordTile,‘KA’, 0, 0, “Helvetica Neue”, 16 )
wordTileText:setReferencePoint( display.CenterReferencePoint )
wordTile:insert(wordTileText)
wordTileText.x,wordTileText.y = 31,11
wordTile.x,wordTile.y = 100,100
Is there some gotcha with newImageRect I should be aware of?
I have the same problem with any other reference point alignment.
Thanks! [import]uid: 13836 topic_id: 27909 reply_id: 327909[/import]