Code example for TextPaint

Methods: setColorsetShadowLayersetTextSizesetTypeface

0
		float[] ltbl = { 0.f, 1.f };
		fHalo = new RadialGradient(w / 2.f, h / 2.f, w * 0.33f, ltgr, ltbl,
				TileMode.CLAMP);
		fHaloPaint = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
		fHaloPaint.setShader(fHalo);
		fTextPaint = new TextPaint(Paint.ANTI_ALIAS_FLAG
				| Paint.DEV_KERN_TEXT_FLAG | Paint.DITHER_FLAG
				| Paint.SUBPIXEL_TEXT_FLAG);
		fTextPaint.setColor(Color.argb(0xff, 0x22, 0x22, 0x22));
		fTextPaint.setTypeface(Typeface.SERIF);
		fTextPaint.setTextSize(h / 2.5f);
		fTextPaint.setShadowLayer(4.f, 2.f, 2.f,
				Color.argb(0xff, 0x22, 0x22, 0x22));
 
		fRollingPaint = new TextPaint(fTextPaint);
		fRollingPaint.setColor(Color.argb(0x88, 0x22, 0x22, 0x22));
		fTextPaint.setShadowLayer(8.f, 4.f, 4.f,
				Color.argb(0x88, 0x22, 0x22, 0x22));
 
	} 
 
	@Override 
Stop searching for code, let great code find you!  Add Codota to your java IDE