2012-05-24 174 views
0

我加了一個srpite image.I將用它作爲button.When我按它,它應該在代碼只below.It作品般的效果,當我寫toouch.event.action_down.But我希望當我的手指時,按鈕應在返回的代碼一樣stuation beforel below.but這是行不通的。觸摸事件上下andengine

  Sprite spriteMusicPicture1 = new Sprite(726.0f, 350.0f, mFaceTextureRegion7){ 
       @Override 
       public boolean onAreaTouched(final TouchEvent pAreaTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) { 
        switch(pAreaTouchEvent.getAction()) { 
         case TouchEvent.ACTION_DOWN:      
          this.setScale(1.25f); 
          this.setAlpha(0.5f); 



         case TouchEvent.ACTION_UP: 
          this.setScale(1.0f); 
          this.setAlpha(1.0f); 




          } 
          return true; 
       } 
      }; 

回答

4

之後每個case你必須把一個打破;否則它不會停止,繼續執行所有線路