【问题标题】:InputMultiplexer working only on a StageInputMultiplexer 仅在舞台上工作
【发布时间】:2016-03-08 10:14:39
【问题描述】:

我有一个libGDX 项目,我想在其中使用多个输入处理器。 imInputMultiplexerstagedialogStagesInputController 和名为Stagedialog 工作正常,但是stage 上的ImageButton 类型Actors 不起作用,点击后无法执行任何操作。

im.addProcessor(stage);
im.addProcessor(inputController);
im.addProcessor(dialog);
Gdx.input.setInputProcessor(im);

什么可能会导致这个问题,我应该检查什么?

【问题讨论】:

  • 如何在这些 ImageButtons 上实现 click() 事件?请出示您的代码
  • 对于 InputMultiplexer,如何处理 eventProcessed 很重要,问题可能存在,但正如上面评论中所述,您需要显示更多代码,否则无法说明任何事情。
  • @ChanandlerBong:谢谢,问题出在事件处理上,使用ChangeListener() 可以正常工作。
  • 由于我的评论很有帮助,我从中做出了回答。如果您不介意,请接受它,这样这个问题就不会悬而未决。

标签: android input libgdx


【解决方案1】:

在处理 InputMultiplexer 时,往往会在事件处理不正确的情况下出现此类问题,因此首先要检查。

【讨论】:

    猜你喜欢
    • 2017-12-17
    • 2015-09-14
    • 2012-11-22
    • 1970-01-01
    • 1970-01-01
    • 2015-07-29
    • 2014-02-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多