tiled 文本位置居中
This commit is contained in:
@@ -113,12 +113,14 @@ module es {
|
||||
obj.textField.size = 12;
|
||||
obj.textField.fontFamily = "sans-serif";
|
||||
if (obj.shape){
|
||||
obj.textField.x = pos.x + (obj.shape.width - obj.textField.width) / 2;
|
||||
obj.textField.y = pos.y - obj.textField.height - 5;
|
||||
obj.textField.x = pos.x + (obj.shape.getBounds().width - obj.textField.width) / 2 + obj.shape.getBounds().x;
|
||||
obj.textField.y = pos.y - obj.textField.height - 5 + obj.shape.getBounds().y;
|
||||
}else{
|
||||
obj.textField.x = pos.x + (obj.width - obj.textField.width) / 2;
|
||||
obj.textField.y = pos.y - obj.textField.height - 5;
|
||||
}
|
||||
obj.textField.background = true;
|
||||
obj.textField.backgroundColor = 0xa0a0a4;
|
||||
obj.textField.textColor = 0xffffff;
|
||||
container.addChild(obj.textField);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user