ゲームを開発しています。これには、上から下に垂直にスクロールする背景画像が必要です。
実際、私のエミュレータのサイズは 320*720(幅*高さ) ですが、背景画像のサイズは 320*3840 です。したがって、Height: 720 から 3840 までの背景画像のスクロールが必要です。
背景画像をスクロールするコードがありますが、背景画像が正しくスクロールされません。私を助けてください。
ここに私のコードがあります、
private Bitmap mBackgroundImageFar; //my image
private int mBGFarMoveY = 0;
mBGFarMoveY = mBGFarMoveY + 2;
int newFarY = mBackgroundImageFar.Height - (- mBGFarMoveY);
if (newFarY <= 0)
{
mBGFarMoveY =0;
canvas.DrawBitmap (mBackgroundImageFar,0,mBGFarMoveY,null);
}
else
{
canvas.DrawBitmap (mBackgroundImageFar,0,mBGFarMoveY,null);
canvas.DrawBitmap (mBackgroundImageFar,0,newFarY, null);
}
書き間違いがありましたら、お許しください。
ありがとうございます、チャクリ。