2012-03-24 2 views
4

입니다. 무대에 배우가 있지만 터치가 내려졌지만 터치 업과 터치 드래그가 호출되지는 않습니다. 무엇이 잘못되었는지에 대한 아이디어가 있습니까?libgdx touchup 및 touchdragged는 호출되지 않지만 터치 다운은

............ 
    stage = new Stage(0, 0, true); 
    Gdx.input.setInputProcessor(stage); 
........... 

    @Override 
    public Actor hit(float arg_x, float arg_y) { 
     if ((arg_x > this.location.x) && (arg_x < (this.location.x + 40)) && (arg_y >  this.location.y) && (arg_y < (this.location.y + 40))) { 
      Gdx.app.log("Tile", "hit char = " + this.GetLetter()); 
      return this; 
     } 
     return null; 
    } 

    @Override 
    public boolean touchDown(float arg_x, float arg_y, int arg2) { 
     Gdx.app.log("Tile", "down char = " + this.GetLetter()); 
     return false; 
    } 

    @Override 
    public void touchDragged(float arg_x, float arg_y, int arg2) { 
     Gdx.app.log("Tile", "tile dragged"); 
    } 

    @Override 
    public void touchUp(float arg_x, float arg_y, int arg2) { 
     Gdx.app.log("Tile", "touchUp"); 
    } 

답변

9

다른 포럼에서 답변을 찾았습니다.

public boolean touchDown(float arg_x, float arg_y, int arg2) { 
     Gdx.app.log("Tile", "down char = " + this.GetLetter()); 
     return false; 
    } 

입니다
public boolean touchDown(float arg_x, float arg_y, int arg2) { 
     Gdx.app.log("Tile", "down char = " + this.GetLetter()); 
     return true; 
    } 

, 그것은 true보다는 false 반환해야해야한다. 적절한 시간에 다른 메소드가 호출됩니다.