/** * Create an instance of {@link LabelStyle} * */ public static LabelStyle createLabelStyle() { return new LabelStyle(); }
/** * Create an instance of {@link LabelStyle} * */ public static LabelStyle createLabelStyle() { return new LabelStyle(); }
/** * Creates a new instance of {@link LabelStyle} and set it to labelStyle. * * This method is a short version for: * <code> * LabelStyle labelStyle = new LabelStyle(); * this.setLabelStyle(labelStyle); </code> * * */ public LabelStyle createAndSetLabelStyle() { LabelStyle newValue = new LabelStyle(); this.setLabelStyle(newValue); return newValue; }
/** * Creates a new instance of {@link LabelStyle} and set it to labelStyle. * * This method is a short version for: * <code> * LabelStyle labelStyle = new LabelStyle(); * this.setLabelStyle(labelStyle); </code> * * */ public LabelStyle createAndSetLabelStyle() { LabelStyle newValue = new LabelStyle(); this.setLabelStyle(newValue); return newValue; }
Label text; LabelStyle textStyle; BitmapFont font = new BitmapFont(); //font.setUseIntegerPositions(false);(Optional) textStyle = new LabelStyle(); textStyle.font = font; text = new Label("Gamever",textStyle); text.setBounds(0,.2f,Room.WIDTH,2); text.setFontScale(1f,1f);
stage = new Stage(); Texture bground = new Texture(Gdx.files.internal("pbBackground.png")); Table table = new Table(); table.setFillParent(true); stage.addActor(table); font = new BitmapFont(Gdx.files.internal("gamefonts.fnt")); font.getData().scale(.1f); skin = new Skin(); pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(Color.WHITE); pixmap.fill(); skin.add("white", new Texture(pixmap)); LabelStyle lstyle = new LabelStyle(); lstyle.font=font; Label mylabel = new Label("HP", lstyle); mylabel.setColor(Color.RED); mylabel.setPosition(1, 6); table.addActor(mylabel); textureBar = new TextureRegionDrawable(new TextureRegion(new Texture(Gdx.files.internal("pb.png")))); barStyle = new ProgressBarStyle(skin.newDrawable("white", Color.DARK_GRAY), textureBar); barStyle.background = new TextureRegionDrawable(new TextureRegion(bground)); barStyle.knobBefore=barStyle.knob; bar = new ProgressBar(0, 10, 0.5f, false, barStyle); bar.setPosition(1, 1); bar.setValue(0); bar.setAnimateDuration(2); table.addActor(bar);
.withColor(GREEN); LabelStyle labelStyle = new LabelStyle().withScale(0.7); LabelStyle idLabelStyle = new LabelStyle() .withColor("00000000") .withColorMode( ColorMode.NORMAL )