public NoClickZone(Widget child, int margin) { super(child); this.child = child; this.margin = margin; setDebug(true); addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { super.clicked(event, x, y); event.handle(); event.stop(); } }); }
public CustomInterface(Stage ui, Skin skin, Object lock) { this.skin = skin; this.ui = ui; customElements = new HashMap<Integer, Widget>(); initSizes(skin); this.lock = lock; EventManager.instance.subscribe(this, Events.ADD_CUSTOM_IMAGE, Events.ADD_CUSTOM_MESSAGE, Events.REMOVE_OBJECTS, Events.REMOVE_ALL_OBJECTS, Events.ADD_CUSTOM_TEXT); }
private void removeObject(Integer id) { Widget toRemove = customElements.get(id); if (toRemove != null) { toRemove.remove(); customElements.remove(id); } }
public MessagesInterface(Skin skin, Object lock) { super(skin); customElements = new HashMap<Integer, Widget>(); headline = new OwnLabel("", skin, "headline"); headline.setColor(1, 1, 0, 1); subhead = new OwnLabel("", skin, "subhead"); this.add(headline).left(); this.row(); this.add(subhead).left(); this.lock = lock; EventManager.instance.subscribe(this, Events.POST_HEADLINE_MESSAGE, Events.CLEAR_HEADLINE_MESSAGE, Events.POST_SUBHEAD_MESSAGE, Events.CLEAR_SUBHEAD_MESSAGE, Events.CLEAR_MESSAGES); }
public EditDialog(String title, Skin skin) { super(title, skin); this.skin = skin; setResizable(false); setKeepWithinStage(false); infoLbl = new Label("", skin); infoLbl.setWrap(true); centerPanel = new Table(skin); infoCell = getContentTable().add((Widget) infoLbl).prefWidth(200); getContentTable().add(new ScrollPane(centerPanel, skin)) .maxHeight(Gdx.graphics.getHeight() * 0.8f) .maxWidth(Gdx.graphics.getWidth() * 0.7f) .minHeight(Gdx.graphics.getHeight() * 0.5f) .minWidth(Gdx.graphics.getWidth() * 0.5f); centerPanel.addListener(new InputListener() { @Override public void enter(InputEvent event, float x, float y, int pointer, com.badlogic.gdx.scenes.scene2d.Actor fromActor) { // EditorLogger.debug("ENTER - X: " + x + " Y: " + y); getStage().setScrollFocus(centerPanel); } }); button("OK", true); button("Cancel", false); // DISABLE the enter key because conflicts when newline in TextFields // key(Keys.ENTER, true); key(Keys.ESCAPE, false); padBottom(10); padLeft(10); padRight(10); }
@Override public float get (Actor actor) { if (actor instanceof Widget) { Widget widget = (Widget) actor; return widget.isVisible() ? widget.getPrefHeight() : 0; } if (actor instanceof Table) { Table table = (Table) actor; return table.isVisible() ? table.getPrefHeight() : 0; } throw new IllegalStateException("Unsupported actor type for PrefHeightIfVisibleValue: " + actor.getClass()); }
@Override public float get (Actor actor) { if (actor instanceof Widget) { Widget widget = (Widget) actor; return widget.isVisible() ? widget.getPrefWidth() : 0; } if (actor instanceof Table) { Table table = (Table) actor; return table.isVisible() ? table.getPrefWidth() : 0; } throw new IllegalStateException("Unsupported actor type for PrefWidthIfVisibleValue: " + actor.getClass()); }
@Override public float get (Actor context) { return getter.get((Widget) context); }
float get (Widget context);