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 6100513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:23:44+00:00 2026-05-23T13:23:44+00:00

I have gotten text to render using opengl es on android and currently am

  • 0

I have gotten text to render using opengl es on android and currently am trying to find out how to “animate” it like in pokemon games where it “reveals” the characters from left to right at a certain speed.
How is this done?

  • 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-05-23T13:23:44+00:00Added an answer on May 23, 2026 at 1:23 pm

    Basically, this “text-sliding-in” is like all other animations.

    For example, look at this sample code:

    public class GameObject {
        // Each element in this char array contains
        // a single character, representing a serie of text.
        private char[] mText;
        // Frames before a new character appears.
        private int mFrames;        
        // Current frame.
        private int mCurrentFrame;
        // Current index (which character is currently the last).
        private int mIndex;
    
        public GameObject(String defaultText, int framesPerCharacter) {
            final int textLength = defaultText.length();
            mText = new char[textLength];
    
            for (int x = 0; x < textLength; x++) {
                mText[x] = defaultText.charAt(x);
            }
    
            mFrames = framesPerCharacter;
        }
    
        public void drawText() {
            // I do not have room enough to explain drawing APIs, but 
            // you'll get the idea.
            for (int x = 0; x < mIndex; x++) {
                // Draw text, from the beginning to the current index.
                // Depending on the drawing API, you might have to
                // change the x and y coordinates for each character.
                APIDrawText.drawText(mText[x]);
            }
    
            // Reset the counter if the character's "animation"
            // is done and add one to the index. 
            // Otherwise, add one to the current frame.
            if (mCurrentFrame >= mFrames) { mCurrentFrame = 0; mIndex++; }
            else { mCurrentFrame++; }
    
            if (mIndex >= mText.length) {
                // Reset the index counter (will display the text all over again).
                mIndex = 0;
            }
        }
    }
    

    Notice that a game object class has more fields describing them, but for example purposes this should be enough.

    /**
     * Basic OpenGL ES implementation on Android.
     * Should contain onSurfaceCreated() and onSurfaceChanged().
     */
    public class GLRenderer extends GLSurfaceView implements Renderer {
        private GameObject mGameObject;
    
        public GLRenderer() { 
            // Add default text and add 25 frames per character.
            mGameObject = new GameObject("Default text!", 25);
        }
    
        /**
         * The ordinary draw function on Android. Your code should
         * look something similiar to this.
         */
        @Override
        public void onDrawFrame(GL10 gl) {
            // Use the method which you got to render text with OpenGL
            // here.
            mGameObject.drawText();         
        }
    }
    

    Well, what happens? To summarize:

    First frame: D <- Increase mCurrentFrame by one.

    Second frame: D <- Increase mCurrentFrame by one.

    …

    Twenty-sixth frame: De <- mIndex has increased to one (it loop through the
    mText variable two times).

    …

    All text has been displayed: <- Reset the mIndex to zero, reset mCurrentFrame
    to zero. This will play the animation from the beginning.

    This is the basic idea. You can add more methods where you change the frames per character amount, change text, slow/speed up the animation after each character, etc.

    I also wrote an example of this, but for the Canvas system. It should be easy for you to adapt to whatever you choose.

    You can find my example here.

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

Sidebar

Related Questions

I have gotten everything working for my class in which I am using Tomcat
I am working on Conway's Game of Life currently and have gotten stuck. My
I'm trying to write text to a local file (i.e. on my laptop) using
Im trying to implement an activity that uses ExpandableListView and I have gotten so
I'm just beginning Android and have gotten myself stuck. I've made a simple app/view.
As a newbie, I'm trying to pull something off and have gotten stuck. I'm
I have am making a page using Ajax, Jquery, and PHP. I have gotten
I am trying to only have the words print out if they occur the
I am trying to auto fill a form (currently using contact form 7) with
We have gotten several emails and phone calls about yellow text appearing on our

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.