I am trying to draw from a tile set to the canvas. My test tile set is 1080 pixels wide. The width of the canvas is 320. When I tell it to draw, I start from (0,0), drawing tiles that are 10x10, and I tell it to stop drawing in the X direction when we hit the canvas width, which is 320.
Theoretically, this should be displaying only 320 pixels, or 32 tiles, of the tile set...but somehow its displaying the entire width of the tile set, just scaled down. Any one have any ideas?
- Code: Select all
while(true)
{
Rect src = new Rect(srcX,srcY,srcX+srcW,srcY+srcH);
Rect dst = new Rect(dstX,dstY,dstX+dstW,dstY+dstH);
c.drawBitmap(mBackgroundImage, src, dst, null);
srcX+=srcW;
dstX+=dstW;
//mLanderImage.
if(srcX >= mCanvasWidth)
//if(i >= 32)
{
srcX=0;
srcY+=srcH;
dstX=0;
dstY+=dstH;
i=0;
}
if(srcY >= mCanvasHeight)
break;
Log.d(TAG, "srcY = " + srcY + " CanvasHeight = " + mCanvasWidth);
i++;
}
Thanks in advance.

