0

srpite画像を追加しました。ボタンとして使用します。押すと、次のコードのようになります。toouch.event.action_downと書いた場合にのみ機能します。ただし、指を上にしたときにボタンを押す必要があります。以下のコードのようにstuationbeforelを返しますが、機能しません。

           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

1 に答える 1

4

それぞれの後に休憩caseを入れる必要があります。 そうしないと、停止せず、すべての行の実行を継続します

于 2012-05-24T20:53:54.657 に答える