Я хочу иметь возможность вращать движущийся спрайт, который также анимирован (у АТМ есть 3 изображения подряд). Как бы я пошел по этому поводу?
Текущий спрайт перемещается по экрану и вращается.
Пока у меня есть этот код: (но он выглядит испорченным)
this._rect = new Rect(0,0, this._spriteWidth, this._spriteHeight);
//this._rect.left = 1 * this._spriteWidth;
//this._rect.right = this._rect.left + this._spriteWidth;
//What the bitmap will be fitted into.
Rect dest = new Rect(current_Position.x, current_Position.y, current_Position.x + this._spriteWidth, current_Position.y + this._spriteHeight);
mMatrix.reset();
mMatrix.postRotate(Degrees, _spriteWidth / 3, _spriteHeight / 2);
mMatrix.postTranslate(current_Position.x, current_Position.y);
this._modified_bitmap = Bitmap.createBitmap(_bitmap, 0, 0, _bitmap.getWidth(), _bitmap.getHeight(), mMatrix, false);
canvas.drawBitmap(_modified_bitmap, _rect, dest, null);
Кто-нибудь может помочь, спасибо?
--- Решено (хотя, если кто-нибудь знает более эффективный способ, пожалуйста, дайте мне знать) ---
mMatrix.reset();
mMatrix.postRotate(Degrees, _spriteWidth / 3, _spriteHeight / 2);
mMatrix.postTranslate(current_Position.x, current_Position.y);
this._modified_bitmap = Bitmap.createBitmap(_bitmap, 0, 0, _spriteWidth, _spriteHeight);
canvas.drawBitmap(_modified_bitmap, mMatrix, null);