Closed mochibits closed 12 years ago
In CCNode's visit, the visible flags has been taken into consideration, isn't it? for the draw function, it doesn't need to set the visibility, it just show the visible objects..
2011/11/3 Kyle < reply@reply.github.com>
Selected and disabled image not being displayed. Visible flags not being set. See code below for my fix. Maybe there's a better way though.
@Override public void draw(GL10 gl) { if (isEnabled_) { if (isSelected_) { normalImage_.setVisible(false); selectedImage_.setVisible(true); selectedImage_.draw(gl); } else { normalImage_.setVisible(true); selectedImage_.setVisible(false); normalImage_.draw(gl); } } else { if (disabledImage_ != null) { normalImage_.setVisible(false); disabledImage_.setVisible(true); disabledImage_.draw(gl); // disabled image was not provided } else { normalImage_.setVisible(true); disabledImage_.setVisible(false); normalImage_.draw(gl); } } }
Reply to this email directly or view it on GitHub: https://github.com/ZhouWeikuan/cocos2d/issues/46
This is Zhou, Weikuan(Ϊ)
Thanks for the (real) fix! =)
Selected and disabled image not being displayed. Visible flags not being set. See code below for my fix. Maybe there's a better way though.