내 코드에 문제가 있습니다.android에서 게임 개발 : 캔버스에서 텍스트 회전
을 : 난 내 응용 프로그램은 즉시 종료됩니다 그렇게되면 내가canvas.restore();
를 호출 할 수 있도록 ...
내 코드의 일부를 캔버스을 복원 내가 모든 작품의 텍스트를 회전하려고하지만 난 그렇게 할 때
터치 화면의 한 부분 :
if (wahrheitswert1 == true) {
x = 480;
y = 100;
// draw bounding rect before rotating text
Rect rect = new Rect();
canvas.translate(x, y);
// undo the translate
canvas.translate(-x, -y);
// rotate the canvas on center of the text to draw
canvas.rotate(-180, x + rect.exactCenterX(), y + rect.exactCenterY());
// draw the rotated text
canvas.drawText("Spieler1 touch", x, y, paint);
//undo the rotate
//canvas.restore();
wahrheitswert1 = false;
canvas.restore();
}
나는 배경 이미지가 화면의 다른 사이트에서 복사됩니다 가지고있는 비트 맵을 복원하지 마십시오. 도움을 주셔서 감사합니다.
사실을 저장하지 않고 복원 할 것이 없습니다 ... – WarrenFaith
내가 무엇을해야하는지 말해 주시겠습니까? 저는 자바 전문가가 아닌 프로그래밍 전문가입니다 – kmartinho
http://developer.android.com/reference/android/graphics/Canvas.html 에서 이전에 저장해야했던 복구 방법에 주목하십시오.). 기본적으로 복원 할 시점의 시점에서 canvas.save()를 호출하여 복원이 호출되면 저장된 점으로 복원합니다. – Contristo