Java Code Examples for com.badlogic.gdx.scenes.scene2d.ui.Skin#get()
The following examples show how to use
com.badlogic.gdx.scenes.scene2d.ui.Skin#get() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResumeVsJoinTest.java From gdx-ai with Apache License 2.0 | 6 votes |
@Override public Actor createActor (final Skin skin) { Table table = new Table(); LabelStyle labelStyle = new LabelStyle(skin.get(LabelStyle.class)); labelStyle.background = skin.newDrawable("white", .6f, .6f, .6f, 1); String branchChildren = "\n spinAround\n selectTarget\n pursue"; table.add(new Label("parallel policy:\"sequence\" orchestrator:\"resume\"" + branchChildren, labelStyle)).pad(5); table.add(new Label("vs", skin)).padLeft(10).padRight(10); table.add(new Label("parallel policy:\"sequence\" orchestrator:\"join\"" + branchChildren, labelStyle)).pad(5); table.row().padTop(15); TextButton startButton = new TextButton("Start", skin); startButton.addListener(new ChangeListener() { @Override public void changed (ChangeEvent event, Actor actor) { oldScreen = container.getScreen(); container.setScreen(new TestScreen(ResumeVsJoinTest.this, skin)); } }); table.add(); table.add(startButton); table.add(); return table; }
Example 2
Source File: InventoryButton.java From bladecoder-adventure-engine with Apache License 2.0 | 5 votes |
private static ButtonStyle getDefaultStyle(Skin skin) { InventoryUIStyle inventoryUIStyle = skin.get(InventoryUIStyle.class); ButtonStyle inventoryButtonStyle = inventoryUIStyle.inventoryButtonStyle; if (inventoryButtonStyle == null) { inventoryButtonStyle = skin.get("inventory", ButtonStyle.class); } return inventoryButtonStyle; }
Example 3
Source File: InputPanel.java From bladecoder-adventure-engine with Apache License 2.0 | 5 votes |
protected void init(Skin skin, String title, String desc, Actor c, boolean mandatory, String defaultValue) { // debug(); this.mandatory = mandatory; this.setSkin(skin); LabelStyle style = new LabelStyle(skin.get(LabelStyle.class)); this.title = new Label(title, style); this.desc = new Label(desc, skin, "subtitle"); this.desc.setWrap(false); this.field = c; // row().expand(); float titleWidth = this.title.getStyle().font.getSpaceXadvance() * 35; add(this.title).width(titleWidth).left().top(); this.title.setWidth(titleWidth); this.title.setWrap(true); // row().expand(); add(field).expandX().left().top(); if (USE_TOOLTIPS) { TextTooltip t = new TextTooltip(desc, skin); this.title.addListener(t); this.field.addListener(t); } else { row().expand(); add(this.desc).colspan(2).left(); } if (defaultValue != null) setText(defaultValue); }
Example 4
Source File: SlotActor.java From libgdx-utils with MIT License | 5 votes |
private static ImageButtonStyle createStyle(Skin skin, Slot slot) { TextureAtlas icons = LibgdxUtils.assets.get("icons/icons.atlas", TextureAtlas.class); TextureRegion image; if (slot.getItem() != null) { image = icons.findRegion(slot.getItem().getTextureRegion()); } else { image = icons.findRegion("nothing"); } ImageButtonStyle style = new ImageButtonStyle(skin.get(ButtonStyle.class)); style.imageUp = new TextureRegionDrawable(image); style.imageDown = new TextureRegionDrawable(image); return style; }
Example 5
Source File: TCheckBox.java From cocos-ui-libgdx with Apache License 2.0 | 4 votes |
public TCheckBox(String text, Skin skin, String styleName) { this(text, skin.get(styleName, CheckBoxStyle.class)); }
Example 6
Source File: PauseButton.java From gdx-ai with Apache License 2.0 | 4 votes |
public PauseButton (Actor cover, Skin skin) { super(PAUSE_AI, skin.get(TextButtonStyle.class)); initialize(cover); }
Example 7
Source File: IntValueLabel.java From gdx-ai with Apache License 2.0 | 4 votes |
public IntValueLabel (CharSequence text, int initialValue, Skin skin) { this(text, initialValue, skin.get(LabelStyle.class)); }
Example 8
Source File: FloatValueLabel.java From GdxDemo3D with Apache License 2.0 | 4 votes |
public FloatValueLabel (CharSequence text, float initialValue, Skin skin) { this(text, initialValue, skin.get(LabelStyle.class)); }
Example 9
Source File: IntValueLabel.java From GdxDemo3D with Apache License 2.0 | 4 votes |
public IntValueLabel (CharSequence text, int initialValue, Skin skin, String styleName) { this(text, initialValue, skin.get(styleName, LabelStyle.class)); }
Example 10
Source File: CustomList.java From bladecoder-adventure-engine with Apache License 2.0 | 4 votes |
public CustomList(Skin skin, CellRenderer<T> r) { this(skin.get(CustomListStyle.class), r); }
Example 11
Source File: Tooltips.java From gdx-skineditor with Apache License 2.0 | 4 votes |
public Tooltips(Skin skin, String styleName, Stage stage) { this(skin.get(styleName, TooltipStyle.class), stage); }
Example 12
Source File: ProgressBar.java From cocos-ui-libgdx with Apache License 2.0 | 4 votes |
public ProgressBar(float min, float max, float stepSize, boolean vertical, Skin skin, String styleName) { this(min, max, stepSize, vertical, skin.get(styleName, ProgressBarStyle.class)); }
Example 13
Source File: ProgressBar.java From cocos-ui-libgdx with Apache License 2.0 | 4 votes |
public ProgressBar(float min, float max, float stepSize, boolean vertical, Skin skin) { this(min, max, stepSize, vertical, skin.get("default-" + (vertical ? "vertical" : "horizontal"), ProgressBarStyle.class)); }
Example 14
Source File: ScnWidget.java From bladecoder-adventure-engine with Apache License 2.0 | 4 votes |
public ScnWidget(Skin skin) { bigFont = skin.get("big-font", BitmapFont.class); defaultFont = skin.get("default-font", BitmapFont.class); setSize(150, 150); tile = new TiledDrawable(Ctx.assetManager.getIcon("transparent-light")); background = skin.getDrawable("background"); faRenderer.setViewport(getWidth(), getHeight()); setLayoutEnabled(true); addListener(inputListner); Ctx.project.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent e) { EditorLogger.debug("ScnWidget Listener: " + e.getPropertyName()); if (e.getPropertyName().equals(Project.NOTIFY_SCENE_SELECTED)) { if (!projectLoadedFlag) setSelectedScene(Ctx.project.getSelectedScene()); } else if (e.getPropertyName().equals(Project.NOTIFY_ACTOR_SELECTED)) { if (!projectLoadedFlag) setSelectedActor(Ctx.project.getSelectedActor()); } else if (e.getPropertyName().equals(Project.NOTIFY_ANIM_SELECTED)) { if (!projectLoadedFlag && Ctx.project.getSelectedFA() != null) setSelectedFA(Ctx.project.getSelectedFA()); } else if (e.getPropertyName().equals(Project.NOTIFY_PROJECT_LOADED)) { projectLoadedFlag = true; } else if (e.getPropertyName().equals("scene")) { setSelectedScene(Ctx.project.getSelectedScene()); setSelectedActor(Ctx.project.getSelectedActor()); } else if (e.getPropertyName().equals("init_animation")) { if (!inScene) setSelectedFA(null); } } }); showSpriteBounds = Boolean .parseBoolean(Ctx.project.getEditorConfig().getProperty("view.showSpriteBounds", "true")); inScene = Boolean.parseBoolean(Ctx.project.getEditorConfig().getProperty("view.inScene", "false")); animation = Boolean.parseBoolean(Ctx.project.getEditorConfig().getProperty("view.animation", "true")); scnMoveIcon = Ctx.assetManager.getIcon("scn_move"); scnRotateIcon = Ctx.assetManager.getIcon("scn_rotate"); scnScaleLockIcon = Ctx.assetManager.getIcon("scn_scale_lock"); scnScaleIcon = Ctx.assetManager.getIcon("scn_scale"); }
Example 15
Source File: ObjectValueLabel.java From GdxDemo3D with Apache License 2.0 | 4 votes |
public ObjectValueLabel (CharSequence text, T initialValue, Skin skin, String styleName) { this(text, initialValue, skin.get(styleName, LabelStyle.class)); }
Example 16
Source File: Dialog.java From uracer-kotd with Apache License 2.0 | 4 votes |
public Dialog (String title, Skin skin, String windowStyleName) { super(title, skin.get(windowStyleName, WindowStyle.class)); setSkin(skin); this.skin = skin; initialize(); }
Example 17
Source File: Dialog.java From uracer-kotd with Apache License 2.0 | 4 votes |
public Dialog (String title, Skin skin) { super(title, skin.get(WindowStyle.class)); this.skin = skin; initialize(); }
Example 18
Source File: Window.java From uracer-kotd with Apache License 2.0 | 4 votes |
public Window (String title, Skin skin, String styleName) { this(title, skin.get(styleName, WindowStyle.class)); setSkin(skin); }
Example 19
Source File: CustomList.java From bladecoder-adventure-engine with Apache License 2.0 | 4 votes |
public CustomList(Skin skin, String styleName) { this(skin.get(styleName, CustomListStyle.class), new CellRenderer<T>()); }
Example 20
Source File: IntValueLabel.java From gdx-ai with Apache License 2.0 | 4 votes |
public IntValueLabel (CharSequence text, int initialValue, Skin skin, String styleName) { this(text, initialValue, skin.get(styleName, LabelStyle.class)); }