本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.Actor.isDescendantOf方法的典型用法代码示例。如果您正苦于以下问题:Java Actor.isDescendantOf方法的具体用法?Java Actor.isDescendantOf怎么用?Java Actor.isDescendantOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.Actor
的用法示例。
在下文中一共展示了Actor.isDescendantOf方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: touchDown
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
@Override
public boolean touchDown(int screenX, int screenY, int pointer, int button) {
// wenn der Actor den fokus kriegen kann, dann kriegt er ihn hiermit auch
if (isFocusOnTouchdown()) {
screenToStageCoordinates(controllerTempCoords.set(screenX, screenY));
Actor target = hit(controllerTempCoords.x, controllerTempCoords.y, true);
if (target != null) {
if (isActorFocussable(target))
setFocussedActor(target);
else for (Actor actor : getFocussableActors()) {
if (target.isDescendantOf(actor))
setFocussedActor(actor);
}
}
}
return super.touchDown(screenX, screenY, pointer, button);
}
示例2: hide
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
@Override
public void hide(Action action) {
if (getStage() != null && getStage() instanceof ControllerMenuStage) {
Actor currentFocussedActor = ((ControllerMenuStage) getStage()).getFocussedActor();
if (previousFocussedActor != null && previousFocussedActor.getStage() == getStage()
&& (currentFocussedActor == null || currentFocussedActor.isDescendantOf(this)))
((ControllerMenuStage) getStage()).setFocussedActor(previousFocussedActor);
Actor currentEscapeActor = ((ControllerMenuStage) getStage()).getEscapeActor();
if (previousEscapeActor != null && previousEscapeActor.getStage() == getStage()
&& (currentEscapeActor == null || currentEscapeActor.isDescendantOf(this)))
((ControllerMenuStage) getStage()).setEscapeActor(previousEscapeActor);
}
super.hide(action);
}
示例3: isActorHittable
import com.badlogic.gdx.scenes.scene2d.Actor; //导入方法依赖的package包/类
protected boolean isActorHittable(Actor actor) {
// Prüfung auf hit
Vector2 center = actor.localToStageCoordinates(new Vector2(actor.getWidth() / 2, actor.getHeight() / 2));
Actor hitActor = hit(center.x, center.y, true);
return hitActor != null && (hitActor.isDescendantOf(actor));
}