-1

ループ内でキャンバスを 600x3840 ピクセル残して移動するより良い方法はありますか? これは私が今までやってきたことです

 imagetwo = Bitmap.createBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.bckgr1));



    protected void onDraw(Canvas canvas) {
        canvas.drawBitmap(imagetwo, x,y, null);

    if (x==0){ 
        x=x-3; y=0;} 
    else 
    { x=x-3; y=0;  }

    if (x<-700)
    { x=0-3; y=0;} 
    else 
    { x=x-3; y=0;  } 
    invalidate();

    }
4

1 に答える 1

0

はい!アニメーターを使用する:

http://developer.android.com/reference/android/animation/Animator.html

および TranslateAnimation:

http://developer.android.com/reference/android/view/animation/TranslateAnimation.html

于 2013-01-23T15:38:28.077 に答える