//Left Alignment [gameBeginLabel setAnchorPoint: ccp(0, 0.5f)];
// Right Alignment
[gameBeginLabel setAnchorPoint: ccp(1, 0.5f)]; // Top Alignment
[gameBeginLabel setAnchorPoint: ccp(0.5f, 0)]; // Bottom Alignment
[gameBeginLabel setAnchorPoint: ccp(0.5f, 1.0f)]; // Center - Default
[gameBeginLabel setAnchorPoint: ccp(0.5f, 0.5f)];
本文介绍了在游戏开发中如何通过设置UI元素的锚点来实现左对齐、右对齐、顶部对齐、底部对齐及居中等布局方式。通过对锚点位置的调整,可以灵活地控制游戏界面上各种标签的位置。
89

被折叠的 条评论
为什么被折叠?



