无法阻止libgdx scene2d / ui / Label变为半透明

时间:2017-08-11 17:50:38

标签: java android libgdx label scene2d

无论我做什么,标签都是半透明的。  表格中的标签(labelA,labelB,labelC)首先是0%透明,但只要您将文字设置为labelA.setText("sometext");,它们就会像他们的兄弟labelWarning一样透明。 labelWarning始终是半透明的。我试图将其添加到没有群组(stage.addActor(labelWarning);)的舞台上,通过a更改labelWarning.getColor().a=1;但没有区别!期待您的帮助

    Label.LabelStyle ls=new 
    Label.LabelStyle(screenGame.getFont(),Color.BROWN);
    Label labelA=new Label("700 metre",ls);
    Label labelB=new Label("700 metre",ls);
    Label labelC=new Label("1500 metre",ls);

    labelWarning=new Label("sd",ls);
    labelWarning.setWrap(true);
    labelWarning.setPosition(50,30);
    labelWarning.setWidth(500);
    labelWarning.setAlignment(Align.top);

    tableEPS=new Table();
    //tableEPS.debug();

    tableEPS.row();
    tableEPS.add(epgrass).pad(10f);
    tableEPS.add(epdesert).pad(10f);
    tableEPS.add(epsnow).pad(10f);
    tableEPS.row();
    tableEPS.add(labelA);
    tableEPS.add(labelB);
    tableEPS.add(labelC);
    tableEPS.row();


    tableEPS.setFillParent(true);
    tableEPS.pack();

    episodesGroup=new Group();
    episodesGroup.setSize(worldwidth,worldheight);
    episodesGroup.addActor(imagebgclouds);
    episodesGroup.addActor(backbutton);
    episodesGroup.addActor(tableEPS);
    episodesGroup.addActor(labelWarning);

    stage=new Stage(screenGame.getViewport());

    stage.addActor(episodesGroup);

0 个答案:

没有答案