How can I make a text with texture instead of text color or gradient(for example png file)? Something like this. I understand the logic, that I should make text color transp
Sorry for posting this late but I think I will be helpful. So to make a textured text, say for example you have a file named my_layout.xml in your layout/ folder that is defined like this :
and in your drawable/ folder you have a picture named texture.png, you just reference in your java code (say in the class MainActivity for instance) this way :
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.my_layout);
TextView welcome = (TextView) findViewById(R.id.some_text_id);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.texture);
Shader shader = new BitmapShader(bitmap,Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);
welcome.getPaint().setShader(shader);
}
}