【问题标题】:Stage response to touch阶段响应触摸
【发布时间】:2016-11-16 09:23:54
【问题描述】:

我希望舞台中的演员在上次触摸后的特定时间后响应触摸

例如我有一个对触摸有反应的演员 通过做一些事情,我不希望其他演员在 1 秒过去之前响应触摸

我该怎么做?

【问题讨论】:

    标签: android libgdx stage scene2d


    【解决方案1】:

    这样的东西可能会起作用,粗略的伪代码和真实代码混合在一起 - 更多用于说明。

    ... previous touch actions finished
    stage.getRoot().setTouchable(Touchable.disabled);
    Timer.schedule(new Task(){
                    @Override
                    public void run() {
                        stage.getRoot().setTouchable(Touchable.enabled);
                    }
                   }
                   , 1.0f        //    (delay in seconds)
                  );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-14
      • 2021-10-31
      • 2016-12-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-24
      • 2023-03-19
      相关资源
      最近更新 更多