So, I am making a Game called Fall Down 4 and currently I am just using the built in font (the font that it usually comes with). Now, I want the Title to look more attractive and Good and to do that, i actually downloaded different fonts from Google. I Then created a assests folder and in that folder i copied the font that i installed in my computer (I looked at the different forums on stack overflow). Now my question is how Do i Change the default font to this new downloaded font. Like I just Don't know where to go to change the font of the Text.
I have seen many people ask this question on this fourm but what i want is different FONTS, a FONT that is not BUILT IN, i wannt to USE the FONT I DOWNLOADED and That is what I need help With.
So Please tell me step by step on how to change the font of the text to the font That I have installed in my computer.
The Code:
public class FallDown4TitleScreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fall_down_title_screen);
Typeface myTypeFace = Typeface.createFromAsset(getAssets(), "Spac3 tech free promo.ttf");
final Button playbutton = (Button) findViewById(R.id.Playbutton);
final Button custButton = (Button) findViewById(R.id.custButton);
final Button settingButton = (Button) findViewById(R.id.settingButton);
final TextView textView = (TextView) findViewById(R.id.textView);
textView.setTypeface(myTypeFace);
playbutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
custButton.setVisibility(View.INVISIBLE);
settingButton.setVisibility(View.INVISIBLE);
textView.setVisibility(View.VISIBLE);
playbutton.setVisibility(View.INVISIBLE);
}
});
}
}