Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8907205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:51:11+00:00 2026-06-15T02:51:11+00:00

This is a real simple problem and I can’t find it anywhere, maybe I’m

  • 0

This is a real simple problem and I can’t find it anywhere, maybe I’m not asking it correctly.

I have been searching to do with TextView and changable text on google and on stackOverflow

I have made a game using andengine much like tetris / bejeweled and the game works fine, I need to add a scoring system and want to output the score to the screen.

Many questions related to text in android talk of TextView but when I use this I get a blank white screen with my text on it.

I want to be able to create a label, position it, and change the text regularly throughout the game.

I’d like to be able to do it without changing xml files as I’m not very good at that.
Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:51:12+00:00Added an answer on June 15, 2026 at 2:51 am

    I worked out how to do it with help from a friend. I’m sure it’s very basic but it’s how I wanted to do it, without using XML files and having text that can be changed at anytime.

    // Text related fields.
    private ChangeableText mText;
    private Font mFont;
    

    in OnLoadResources

    public void onLoadResources() {
    
    this.mFontTexture = new BitmapTextureAtlas(256, 256, TextureOptions.BILINEAR);
    this.mFont = new Font(this.mFontTexture, Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 32, true, Color.BLACK);
    
    //Don't forget to load the font (along with other images)
    this.mEngine.getTextureManager().loadTextures(this.mTimerImage, this.mbackgroundImage,  this.mFontTexture);
    this.mEngine.getFontManager().loadFont(this.mFont);
    

    in OnLoadScene

    public Scene onLoadScene() 
    {   
    
    final Scene scene = new Scene();
    
    //Initialise your other variables...
    
    //Give your text a position on screen, font, and fill it with some text and character count
    //I used it for a score to be shown.
    mText = new ChangeableText(490, 800, GameActivity.this.mFont, "", 20);
    
    scene.attachChild(mText);
    return scene;
    }
    

    I used my text for a variable score to be shown later on in the game and everytime the player’s score increases I called the Score method.

    private void Score(int value)
    {
        playerScore += value;
    
        mText.setText(String.valueOf(playerScore));
    }
    

    This updated the score every frame as I called it from my update method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seem so simple, and yet I can't find a solution anywhere. What I
I'm new to jQuery so this may be a real simple answer. I have
This is a real newbie question. I have simple app that selects a picture
So this should be a real easy question but I can't seem to find
I have been trying to solve this problem for hours (searched here as well
EDIT: I finally found a real simple solution to this problem, using the CAGradientLayer
Okay this seems like a real noob question. I currently have a simple html
I've been struggling with this problem for a while now and can't seem to
I have a simple, real life problem I want to solve using an OO
Can some one please explain why this simple form doesnt work? The problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.