com.badlogic.gdx.scenes.scene2d.Actor.notify()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(83)

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

Actor.notify介绍

[英]Notifies this actor's listeners of the event. The event is not propagated to any parents. Before notifying the listeners, this actor is set as the Event#getListenerActor(). The event Event#setTarget(Actor)must be set before calling this method. If this actor is not in the stage, the stage must be set before calling this method.
[中]将事件通知此参与者的侦听器。事件不会传播到任何父级。在通知侦听器之前,此参与者被设置为事件#GetListenerator()。调用此方法之前必须设置事件#setTarget(Actor)。如果此参与者不在stage中,则必须在调用此方法之前设置stage。

代码示例

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

notify(event, true);
if (event.isStopped()) return event.isCancelled();
notify(event, false);
if (!event.getBubbles()) return event.isCancelled();
if (event.isStopped()) return event.isCancelled();

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

notify(event, true);
if (event.isStopped()) return event.isCancelled();
notify(event, false);
if (!event.getBubbles()) return event.isCancelled();
if (event.isStopped()) return event.isCancelled();

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

public static void simulateClickGlobal(Actor actor, int button, int pointer, float stageX, float stageY) {
  InputEvent event = Pools.obtain(InputEvent.class);
  event.setStage(actor.getStage());
  event.setRelatedActor(actor);
  event.setTarget(actor);
  event.setStageX(stageX);
  event.setStageY(stageY);
  event.setButton(button);
  event.setPointer(pointer);
  event.setType(InputEvent.Type.touchDown);
  actor.notify(event, false);
  event.setType(InputEvent.Type.touchUp);
  actor.notify(event, false);
  Pools.free(event);
}

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

notify(event, true);
if (event.isStopped()) return event.isCancelled();
notify(event, false);
if (!event.getBubbles()) return event.isCancelled();
if (event.isStopped()) return event.isCancelled();

相关文章