绘制Text
/**
* Draw the text, with origin at (x,y), using the specified paint. The origin is interpreted
* based on the Align setting in the paint.
*
* @param text The text to be drawn
* @param x The x-coordinate of the origin of the text being drawn
* @param y The y-coordinate of the baseline of the text being drawn
* @param paint The paint used for the text (e.g. color, size, style)
*/
public void drawText(@NonNull String text, float x, float y, @NonNull Paint paint) {
super.drawText(text, x, y, paint);
}
翻转Text
private void drawText(Canvas canvas ,String text , float x ,float y,Paint paint ,float angle){
if(angle != 0){
canvas.rotate(angle, x, y);
}
canvas.drawText(text, x, y, paint);
if(angle != 0){
canvas.rotate(-angle, x, y);
}
}