【发布时间】:2020-09-16 22:54:27
【问题描述】:
将 TextBtton 放入 HorizontalGroup,然后缩放它们会导致视图扭曲,即使居中对齐也是如此。
add_button = new TextButton("+",textButtonStyle);
add_button.setTransform(true);
add_button.setScale(0.7f);
add_button.setDebug(true);
remove_button = new TextButton("-",textButtonStyle);
remove_button.setTransform(true);
remove_button.setScale(0.7f);
remove_button.setDebug(true);
HorizontalGroup brush_op_group = new HorizontalGroup();
brush_op_group.addActor(remove_button);
brush_op_group.addActor(add_button);
brush_op_group.setDebug(true);
结果如下图:
似乎按钮位置是根据其未缩放的大小计算的。 如何纠正?
【问题讨论】: