cantは、開始位置がどこかランダムではないようにテキストを回転する方法を理解していません。 (アニメーション化したくない)私はちょうど開始位置を指定したい。円のパスでdrawTextOnPathによって作成されたテキストをどのように回転させることができますか?
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new GraphicsView(this));
}
private static class GraphicsView extends View {
private static final String QUOTE = "Nobody uses Java anymore. It's this big heavyweight ball and chain.";
Path circle;
Paint tPaint;
public GraphicsView(Context context) {
super(context);
tPaint = new Paint();
tPaint.setColor(Color.BLUE);
tPaint.setTextSize(30);
tPaint.setAntiAlias(true);
//setBackgroundResource(R.drawable.background);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
circle = new Path();
int centerX = getWidth()/2;
int centerY = getHeight()/2;
circle.addCircle(centerX, centerY, Math.min(centerX, centerY), Direction.CW);
canvas.drawTextOnPath(QUOTE, circle, 0, 30, tPaint);
}
}
私はHOFFSET、それが働いたこと、それが見えた最初のを変更しようとしたんでしたが、uはその一例urselfをしようとした場合uが表示されますそのHOFFSET = 700であるならば、私は、テキストを開始する位置、の終わりテキストが欠落しています。 – BlastFire
ありがとうございます。それは私のために働いた... – Dharmendra