Open GoogleCodeExporter opened 9 years ago
也试过用currentFrame/100,限定alpha在0.0F到1.0F之间,也是没用…
…
Original comment by OGCs...@gmail.com
on 20 May 2011 at 9:44
找到解决方案了……
public void update(long timer) {
if(type == TYPE_FADE_IN){
currentFrame++;
if (currentFrame <= maxFrame) {
this.setOpacity(currentFrame/maxFrame);
}
else
{
this.setVisible(false);
}
}
super.update(timer);
}
public void setOpacity(float opacity) {
this.opacity = opacity;
}
public void createUI(LGraphics g) {
if (!this.isVisible()) {
return;
}
if (stop) {
return;
}
if (opacity > 0) {
g.setAlpha(this.opacity);
}
super.createUI(g);
}
Original comment by OGCs...@gmail.com
on 21 May 2011 at 5:39
Original issue reported on code.google.com by
OGCs...@gmail.com
on 20 May 2011 at 9:08