/** Removes the touch, keyboard, and scroll focused actors. */ public void unfocusAll () { setScrollFocus(null); setKeyboardFocus(null); cancelTouchFocus(); }
/** Removes the touch, keyboard, and scroll focused actors. */ public void unfocusAll () { setScrollFocus(null); setKeyboardFocus(null); cancelTouchFocus(); }
/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }
/** Removes the touch, keyboard, and scroll focused actors. */ public void unfocusAll () { setScrollFocus(null); setKeyboardFocus(null); cancelTouchFocus(); }
/** Removes the touch, keyboard, and scroll focus for the specified actor and any descendants. */ public void unfocus (Actor actor) { cancelTouchFocus(actor); if (scrollFocus != null && scrollFocus.isDescendantOf(actor)) setScrollFocus(null); if (keyboardFocus != null && keyboardFocus.isDescendantOf(actor)) setKeyboardFocus(null); }
private void updateViewport() { viewport.setUnitsPerPixel(scale); ViewController currentController = interfaceService.getCurrentController(); if (currentController != null) { currentController.getStage().cancelTouchFocus(); } Gdx.app.postRunnable(new Runnable() { @Override public void run() { app.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); } }); } }
private void cancelChildTouchFocusOf(Group group) { SnapshotArray<Actor> children = group.getChildren(); children.begin(); int size = children.size; for (int i = 0; i < size; i++) { Actor child = children.get(i); if (getStage() == null) { break; } getStage().cancelTouchFocus(child); if (child instanceof Group) { cancelChildTouchFocusOf((Group) child); } } children.end(); }
/** {@link #pack() Packs} the dialog (but doesn't set the position), adds it to the stage, sets it as the keyboard and scroll * focus, clears any actions on the dialog, and adds the specified action to it. The previous keyboard and scroll focus are * remembered so they can be restored when the dialog is hidden. * @param action May be null. */ public Dialog show (Stage stage, Action action) { clearActions(); removeCaptureListener(ignoreTouchDown); previousKeyboardFocus = null; Actor actor = stage.getKeyboardFocus(); if (actor != null && !actor.isDescendantOf(this)) previousKeyboardFocus = actor; previousScrollFocus = null; actor = stage.getScrollFocus(); if (actor != null && !actor.isDescendantOf(this)) previousScrollFocus = actor; pack(); stage.addActor(this); stage.cancelTouchFocus(); stage.setKeyboardFocus(this); stage.setScrollFocus(this); if (action != null) addAction(action); return this; }