当前位置: 动力学知识库 > 问答 > 编程问答 >

scroll text left to right on canvas android with overlay

问题描述:

Hello my canvas is simple on drawtext i am doing this

String rotatedtext = "text 1";

Paint paint = new Paint();

paint.setColor(Color.RED);

paint.setStyle(Paint.Style.FILL);

paint.setTextSize(40);

canvas.drawPoint(30.0f, 50.0f, paint);

canvas.drawText(rotatedtext, canvas.getWidth() / 3, canvas.getHeight() / 2, paint);

String rotatedtext = "text 2 ";

Paint paint = new Paint();

paint.setColor(Color.RED);

paint.setStyle(Paint.Style.FILL);

paint.setTextSize(40);

canvas.drawBitmap(canvasBmp, 0, 0, paint);

canvas.drawPoint(30.0f, 50.0f, paint);

canvas.drawText(rotatedtext, canvas.getHeight() / 3, canvas.getWidth() / 2, paint);

now the overlay text 2 over text 1

now i want if i can scroll the text 2 from left to right keeping it overlay ?

also the

canvas.getWidth /2

does not bring middle of the canvas what i am looking for

分享给朋友:
您可能感兴趣的文章:
随机阅读: