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

  • SEARCH
  • Home
  • 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 7943937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:24:55+00:00 2026-06-04T00:24:55+00:00

Before I delve into some serious lowlevel debugging, I was just wondering if there

  • 0

Before I delve into some serious lowlevel debugging, I was just wondering if there was any problem with the concept of drawing text on a sprite.
Trawling through the API examples I noticed there is nowhere this is being done. All text sprites are pre-rendered into pngs
I can almost see something trying to be drawn, but only appears white flecks or lines
Any advice would be appreciated
Cheers

public class Tile extends Sprite {
    private static BitmapTextureAtlas mBitmapTextureAtlas;
    private static TextureRegion mBoxTextureRegion;
    private static BitmapTextureAtlas mFontTexture;
    private static Font mFont;
    String letter;
    private Text mText;
    public int score;

    public Tile(String letter, int score, float x, float y, float width, float height) {
        super(x, y, width, height, mBoxTextureRegion);
        this.letter = letter;
        this.score = score;
    }

    public static void loadResources(Context context, Engine mEngine) {
        Tile.mFontTexture = new BitmapTextureAtlas(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
        Tile.mFont = FontFactory.createFromAsset(Tile.mFontTexture, context, "Arial Rounded MT.ttf", 64, true, Color.WHITE);

        mEngine.getTextureManager().loadTexture(Tile.mFontTexture);
        mEngine.getFontManager().loadFont(Tile.mFont);

        Tile.mBitmapTextureAtlas = new BitmapTextureAtlas(128, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

        Tile.mBoxTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(Tile.mBitmapTextureAtlas, context, "rect3761.png", 0, 0);

        mEngine.getTextureManager().loadTexture(Tile.mBitmapTextureAtlas);

    }

    public void draw(GraphicScene scene) {
        if (letter != null) {
            this.mText = new Text(50, 50, Tile.mFont, letter, HorizontalAlign.CENTER);
            // this.mText.setBlendFunction(GL10.GL_SRC_ALPHA,
            // GL10.GL_ONE_MINUS_SRC_ALPHA);
            // this.mText.setAlpha(0.5f);
            this.attachChild(this.mText);
            scene.attachChild(this);
        }
    }
}
  • 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-04T00:24:56+00:00Added an answer on June 4, 2026 at 12:24 am

    I did come across user post of a “SpriteButton”, which looks like it does what you (and I) are looking to do, at:
    http://www.andengine.org/forums/tutorials/spritebutton-class-t7440.html

    In the comments you’ll notice a mention of a built-in AndEngine class called a ButtonSprite, but I have not seen any actual code that refers to it. It may be in another branch of the AndEngine source.

    Note that you’ll need to create and load a font, as well as a textureregion before instantiating a SpriteButton.

    I am also looking into how well the SpriteButton handles rotation. Translation (via user touch) seems to work okay.

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

Sidebar

Related Questions

Before I delve into the abyss of Microsoft documentation any deeper, I'd like to
Before I delve into it, I'm very new to Android and I have just
Before going into my problem, I will post reference where I found partial solution:
Before I go ahead and try to code my own, are there any functions
Before I start, I know there is this post and it doesn't answer my
Before I jump headlong into C#... I've always felt that C, or maybe C++,
Before I start let me say I am new to RavenDB. I am just
Before I move on - is there already a type list implementation either in
Before a developer delivers any code to a change set is it possible to
Before I plan to apply some algorithm, wanted to clarify, whether easier solution 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.