List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Skin getColor
public Color getColor(String name)
From source file:com.badlogic.gdx.ai.tests.utils.scene2d.FloatValueLabel.java
License:Apache License
public FloatValueLabel(CharSequence text, float initialValue, Skin skin, String fontName, String colorName) { this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))); }
From source file:com.badlogic.gdx.ai.tests.utils.scene2d.FpsLabel.java
License:Apache License
public FpsLabel(CharSequence text, Skin skin, String fontName, String colorName) { this(text, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))); }
From source file:com.badlogic.gdx.ai.tests.utils.scene2d.IntValueLabel.java
License:Apache License
public IntValueLabel(CharSequence text, int initialValue, Skin skin, String fontName, String colorName) { this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))); }
From source file:com.bladecoder.engineeditor.ui.components.HeaderPanel.java
License:Apache License
@SuppressWarnings("unchecked") public HeaderPanel(Skin skin, String title) { titleLbl = new Label(title, skin); north = new HorizontalGroup(); collapseImg = new Image(); collapseImg.setScaling(Scaling.none); if (collapsable) { north.addActor(collapseImg);/*from ww w . j a v a 2 s .c om*/ collapseImg.setDrawable(new TextureRegionDrawable(Ctx.assetManager.getIcon("ic_open"))); } top().left(); north.addActor(titleLbl); north.align(Align.left); north.fill(); add(north).expandX().fillX(); row(); Image image = new Image(skin.getDrawable("white_pixel")); image.setColor(skin.getColor("separator-color")); add(image).height(2).padBottom(4f).expandX().fill(); row().top().left(); contentCell = add().expand().fill(); if (collapsable) { titleLbl.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { toggleCollapse(); invalidateHierarchy(); } }); collapseImg.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { toggleCollapse(); invalidateHierarchy(); } }); } // setDebug(true); }
From source file:com.gsn.engine.template.GsnLabel.java
License:Apache License
/** Creates a label, using a {@link LabelStyle} that has a BitmapFont with the specified name and the specified color from the * skin. */// w w w .j a v a 2 s .c om public GsnLabel(String text, String fontName, String colorName, Skin skin) { this(text, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName)), null); }
From source file:com.mygdx.game.ui.ObjectValueLabel.java
License:Apache License
public ObjectValueLabel(CharSequence text, T initialValue, Skin skin, String fontName, String colorName) { this(text, initialValue, new LabelStyle(skin.getFont(fontName), skin.getColor(colorName))); }
From source file:com.zombie.game.gui.labels.FpsLabel.java
License:Apache License
public FpsLabel(CharSequence text, Skin skin, String fontName, String colorName) { this(text, new Label.LabelStyle(skin.getFont(fontName), skin.getColor(colorName))); }
From source file:es.eucm.ead.editor.view.builders.scene.components.transformanimations.TransformAnimationEditor.java
License:Open Source License
public TransformAnimationEditor(Controller c, String componentId, String titleI18nKey) { super(c.getApplicationAssets().getSkin()); this.controller = c; this.componentId = componentId; switchWidget.addListener(new ChangeListener() { @Override// ww w. j a v a 2s . com public void changed(ChangeEvent event, Actor actor) { if (switchWidget.isChecked()) { controller.action(AddComponent.class, entity, buildComponent()); } else { removeComponent(); } } }); Skin skin = controller.getApplicationAssets().getSkin(); setTitle(controller.getApplicationAssets().getI18N().m(titleI18nKey)); buttons = new LinearLayout(true); addBodyRow(buttons); buttons.add(easeButton = new StatesButton(SkinConstants.STYLE_CONTEXT, skin, SkinConstants.IC_EASE_LINEAR, SkinConstants.IC_EASE_IN_CUBIC, SkinConstants.IC_EASE_OUT_CUBIC, SkinConstants.IC_EASE_IN_OUT_CUBIC, SkinConstants.IC_EASE_IN_BOUNCE, SkinConstants.IC_EASE_OUT_BOUNCE)); easeButton.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { controller.action(SetField.class, animation, FieldName.EASE, getSelectedEase()); } }); buttons.add(yoyoButton = new StatesButton(SkinConstants.STYLE_CONTEXT, skin, SkinConstants.IC_YOYO, SkinConstants.IC_NO_YOYO)); yoyoButton.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { controller.action(SetField.class, animation, FieldName.YOYO, yoyoButton.getSelectedIndex() == 0); } }); buttons.add(repeatButton = new StatesButton(SkinConstants.STYLE_CONTEXT, skin, SkinConstants.IC_REPLAY, SkinConstants.IC_REPEAT)); repeatButton.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { if (repeatButton.getSelectedIndex() == 0) { controller.action(SetField.class, animation, FieldName.REPEAT, -1); } else { controller.action(SetField.class, animation, FieldName.REPEAT, 0); } } }); buttons.add(repeats = new Label("100", skin)).expandX(); buttons.setComputeInvisibles(true); repeats.setAlignment(Align.center); repeats.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { controller.action(ShowSpinner.class, "Repeat", "times", animation.getRepeat(), 0, 100, TransformAnimationEditor.this); } }); LinearLayout speedRow = new LinearLayout(true); Image speedometer = new Image(skin, SkinConstants.IC_SPEED); speedometer.setColor(skin.getColor(SkinConstants.COLOR_GRAY)); speedPointer = new Image(skin, SkinConstants.IC_SPEED_POINTER); speedPointer.pack(); speedPointer.setOrigin(speedPointer.getWidth() / 2, speedPointer.getHeight() / 4); speedPointer.setColor(skin.getColor(SkinConstants.COLOR_GRAY)); speedRow.add(new StackContainer(speedometer, speedPointer)).margin(WidgetBuilder.dpToPixels(12)).centerY(); speedRow.add(speed = new Slider(0.0f, 1.0f, 0.01f, false, skin)).expandX(); speed.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { controller.action(SetField.class, animation, FieldName.SPEED, speed.getValue()); } }); addBodyRow(speedRow); }
From source file:es.eucm.ead.editor.view.widgets.galleries.TabsGallery.java
License:Open Source License
public TabsGallery(String title, String icon, Skin skin, I18N i18N) { setFillParent(true);// w w w .j a v a 2 s.c o m this.skin = skin; this.i18N = i18N; toolbar = new LinearLayout(false); toolbar.add(topRow = buildTopRow(title, icon)).expandX(); toolbar.add(tabs = new Tabs(skin)).left(); toolbar.background(skin.getDrawable(SkinConstants.DRAWABLE_TOOLBAR)); toolbar.backgroundColor(skin.getColor(SkinConstants.COLOR_BROWN_MOKA)); addActor(toolbar); background = skin.getDrawable(SkinConstants.DRAWABLE_GRAY_100); }
From source file:es.eucm.ead.editor.view.widgets.modelwidgets.ModelTextField.java
License:Open Source License
public ModelTextField(Skin skin, String style, String color, DataType type) { super("0", skin, style); setColor(skin.getColor(color)); this.inputType = type; }