Using java Syntax Highlighting
- /**
- * Draw specified text with a fully sourrounding shadow.
- *
- * @param canvas - Canvas we will draw to
- * @param text - Text we will draw
- * @param x - x position
- * @param y - y position
- * @param textPaint - Paint object used to draw the actual text
- * @param shadowPaint - Paint object used to draw the background shadow
- */
- public static void drawTextShadowed(Canvas canvas, String text, float x, float y, Paint textPaint, Paint shadowPaint) {
- // Draw all 4 sides of the shadow
- canvas.drawText(text, x-1, y, shadowPaint);
- canvas.drawText(text, x, y+1, shadowPaint);
- canvas.drawText(text, x+1, y, shadowPaint);
- canvas.drawText(text, x, y-1, shadowPaint);
- // Draw the final overlay text in the middle
- canvas.drawText(text, x, y, textPaint);
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Cheers,
Moss


