我在子实体上设置 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);
现在我想将此背景实体的 Alpha 设置为 0:
m_background.setAlpha(0.0f);
我的印象是子实体也会受到影响,不是吗?除了直接在子实体上设置 alpha 之外,我怎么能做到这一点?有没有更好的办法?
提前致谢, 泽德