Java Code Examples for com.badlogic.gdx.scenes.scene2d.Touchable#disabled()

The following examples show how to use com.badlogic.gdx.scenes.scene2d.Touchable#disabled() . 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: BaseWidgetParser.java    From cocos-ui-libgdx with Apache License 2.0 5 votes vote down vote up
private Touchable deduceTouchable(Actor actor, ObjectData widget) {
    if (widget.isTouchEnable()) {
        return Touchable.enabled;
    } else if (Touchable.childrenOnly.equals(actor.getTouchable())) {
        return Touchable.childrenOnly;
    } else {
        return Touchable.disabled;
    }
}
 
Example 2
Source File: BeltGrid.java    From riiablo with Apache License 2.0 5 votes vote down vote up
private void updateItems(boolean hidden) {
  Touchable touchable = hidden ? Touchable.disabled : Touchable.enabled;
  SnapshotArray<Actor> snapshot = getChildren();
  Actor[] children = snapshot.begin();
  for (Actor child : children) {
    StoredItem item = (StoredItem) child;
    if (item == null) continue;
    if (item.getY() >= boxHeight) item.setTouchable(touchable);
  }
  snapshot.end();
}
 
Example 3
Source File: MundusSplitPane.java    From Mundus with Apache License 2.0 5 votes vote down vote up
@Override
public Actor hit(float x, float y, boolean touchable) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (handleBounds.contains(x, y)) {
        return this;
    } else {
        return super.hit(x, y, touchable);
    }
}
 
Example 4
Source File: MundusMultiSplitPane.java    From Mundus with Apache License 2.0 5 votes vote down vote up
@Override
public Actor hit(float x, float y, boolean touchable) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (getHandleContaining(x, y) != null) {
        return this;
    } else {
        return super.hit(x, y, touchable);
    }
}
 
Example 5
Source File: MultiSplitPane.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
@Override
public Actor hit (float x, float y, boolean touchable) {
	if (touchable && getTouchable() == Touchable.disabled) return null;
	if (getHandleContaining(x, y) != null) {
		return this;
	} else {
		return super.hit(x, y, touchable);
	}
}
 
Example 6
Source File: VisSplitPane.java    From vis-ui with Apache License 2.0 5 votes vote down vote up
@Override
public Actor hit (float x, float y, boolean touchable) {
	if (touchable && getTouchable() == Touchable.disabled) return null;
	if (handleBounds.contains(x, y)) {
		return this;
	} else {
		return super.hit(x, y, touchable);
	}
}
 
Example 7
Source File: DiePane.java    From dice-heroes with GNU General Public License v3.0 4 votes vote down vote up
@Override public Actor hit(float x, float y, boolean touchable) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    return x >= 0 && x < getWidth() && y >= 0 && y < getHeight() ? this : null;
}
 
Example 8
Source File: ChatActor.java    From Cubes with MIT License 4 votes vote down vote up
@Override
public Touchable getTouchable() {
  return open.isEnabled() ? Touchable.enabled : Touchable.disabled;
}