com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.hit()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup.hit()方法的一些代码示例,展示了WidgetGroup.hit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WidgetGroup.hit()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup
类名称:WidgetGroup
方法名:hit

WidgetGroup.hit介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

public Actor hit (float x, float y, boolean touchable) {
  if (clip) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: libgdx/libgdx

public Actor hit (float x, float y, boolean touchable) {
  if (clip) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: libgdx/libgdx

public Actor hit (float x, float y, boolean touchable) {
  if (clip) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: libgdx/libgdx

public Actor hit (float x, float y, boolean touchable) {
  if (clip) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: libgdx/libgdx

public Actor hit (float x, float y, boolean touchable) {
  if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  if (touchable && getTouchable() == Touchable.enabled && isVisible()) {
    if (scrollX && touchScrollH && hScrollBounds.contains(x, y)) return this;
    if (scrollY && touchScrollV && vScrollBounds.contains(x, y)) return this;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: libgdx/libgdx

public Actor hit (float x, float y, boolean touchable) {
  if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  if (touchable && getTouchable() == Touchable.enabled && isVisible()) {
    if (scrollX && touchScrollH && hScrollBounds.contains(x, y)) return this;
    if (scrollY && touchScrollV && vScrollBounds.contains(x, y)) return this;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

@Override
public Actor hit(float x, float y, boolean touchable) {
  float primaryPos = isVertical ? y : x;
  
  Actor hitActor = super.hit(x, y, touchable);
  if (hitActor == null) {
    return null;
  }
  if (hitActor == this) {
    return this;
  }
  if(isNotTouchInBorders(primaryPos)) {
    return null;
  } else {
    return hitActor;
  }
}

代码示例来源:origin: kotcrab/vis-ui

@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);
  }
}

代码示例来源:origin: kotcrab/vis-ui

@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);
  }
}

代码示例来源:origin: mbrlabs/Mundus

@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);
  }
}

代码示例来源:origin: mbrlabs/Mundus

@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);
  }
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

public Actor hit (float x, float y, boolean touchable) {
  if (clip) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

public Actor hit (float x, float y, boolean touchable) {
  if (clip) {
    if (touchable && getTouchable() == Touchable.disabled) return null;
    if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  }
  return super.hit(x, y, touchable);
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

@Override
  public Actor hit(float x, float y, boolean touchable) {
    Actor hitActor = super.hit(x, y, touchable);
    if (hitActor != null) {
      return hitActor;
    }
    if ( ! this.isTouchable() ) return null;
    return x >= getX() && x < getWidth() && y >= getY() && y < getHeight() ? this : null;
  }
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

public Actor hit (float x, float y, boolean touchable) {
  if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  if (touchable && getTouchable() == Touchable.enabled && isVisible()) {
    if (scrollX && touchScrollH && hScrollBounds.contains(x, y)) return this;
    if (scrollY && touchScrollV && vScrollBounds.contains(x, y)) return this;
  }
  return super.hit(x, y, touchable);
}

相关文章