我在为子实体设置Alpha时遇到问题.我创建一个Rectangle实体并将Text实体附加到矩形,如下所示:
m_background = new Rectangle(0.0f, 0.0f, m_activity.getCamera().getWidth(), m_activity.getCamera().getHeight(), m_activity.getVertexBufferObjectManager());
m_background.setColor(0.0f, 0.0f, 0.0f);
FontFactory.setAssetBasePath("font/");
final ITexture fontTexture = new BitmapTextureAtlas(m_activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
this.m_Font = FontFactory.createFromAsset(m_activity.getFontManager(), fontTexture, m_activity.getAssets(), "Droid.ttf", 48, true, android.graphics.Color.WHITE);
this.m_Font.load();
Text text = new Text(100, 300, this.m_Font, "LoadingScreen", new TextOptions(HorizontalAlign.RIGHT), m_activity.getVertexBufferObjectManager());
m_background.attachChild(text);
Run Code Online (Sandbox Code Playgroud)
现在我想将此背景实体的Alpha设置为0:
m_background.setAlpha(0.0f);
Run Code Online (Sandbox Code Playgroud)
我的印象是儿童实体也会受到影响,情况并非如此吗?除了直接在子实体上设置alpha之外,我怎么能这样做呢?有没有更好的办法?
谢谢,Zerd