本文整理匯總了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));
}