libgdx - Changing color and alpha of actor doesn't work in Scene2D -
changing color , alpha of actor doesn't work in scene2d; scaleto, moveby work though. can issue?
@override public void render(float alpha){ stage.act(delta); table.settransform(true); //works table.addaction(actions.scaleto(2.3f, 2.5f, 2f))); //does not work table.addaction(actions.alpha(0.2f, 2f)); //does not work either table.addaction(actions.color(new color(1f,1f,1f, 0.2f), 2f)); stage.draw(); }
method render()
called every time screen going rendered. code starts actions beginning every frame , nothing changes.
you should move these lines render()
method other place (for example show()
method of screen
object):
table.settransform(true); //works table.addaction(actions.scaleto(2.3f, 2.5f, 2f))); //does not work table.addaction(actions.alpha(0.2f, 2f)); //does not work either table.addaction(actions.color(new color(1f,1f,1f, 0.2f), 2f));
Comments
Post a Comment