Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何制作文本以使每个字母在andengine GLES 2中都是随机颜色?对于随机颜色,我可以去
int red = (int) (Math.random() * 254) + 1; int green = (int) (Math.random() * 254) + 1; int blue = (int) (Math.random() * 254) + 1; Color pColor = new Color(red, green, blue);
但我怎样才能将它单独设置为每个字母?
每个字母都必须是它自己的Text并随机设置每个字母的颜色 - 就这样做
Text
当你创建时,在创建时Text将颜色设置为白色,然后将其更改为你的随机颜色
顺便说一句,(我知道)没有办法一次性完成Text