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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:53:56+00:00 2026-05-25T06:53:56+00:00

I want to have a virtual dpad in an Android game so that when

  • 0

I want to have a virtual dpad in an Android game so that when you touch the forwards button the camera moves forwards and back/left/and right do the same(But for their respective direction). I am able to draw textured cubes to signify the floor but now I am stuck at drawing my virtual dpad. My attempt that is the wrong way to do this is in my draw function to have a canvas(How I would normally draw a 2d object) and the opengl call.

    @Override
public void onDrawFrame(GL10 gl) {

    // TODO Auto-generated method stub
       gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
        Canvas c = new Canvas();
        c.drawBitmap(bitmap, 0, 0, new Paint());

       gl.glLoadIdentity();              
       for(int i =0;i<91;i++)
          {
              myfloortiles[i].draw(gl);
          }
}

Bitmap is a png image that is set to an actual value.
How would you draw a 2d bitmap in the foreground to work as a heads up display or button? What should I search for?

  • 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-25T06:53:57+00:00Added an answer on May 25, 2026 at 6:53 am

    After you draw your 3D-scene you need to change to an Orthographic projection (glOrtho if fixed-function pipeline) and reset your matrix stack (glLoadIdentity( ), again if fixed-function).

    By doing this, your 3D-scene is drawn properly, and then your 2D/Ortho HUD/GUI is drawn on top of it.

    glOrtho

    glLoadIdentity

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

Sidebar

Related Questions

I have a virtual path (example: ~/Images/Banner.jpg) and I want to make that an
I have an abstract class with a pure virtual function f() and i want
want to have a Hyperlink-Button in a gridView in which I can display a
I want to have a select-only ComboBox that provides a list of items for
I want to have a text box that the user can type in that
I want to have two items on the same line using float: left for
I have Angle class that I want initialized to a random value. The Angle
I have a virtual directory setup in one of my web apps that needs
I have virtual machine that has windows 7 + visual studio 2010 setup, and
I have VMWare virtual machine with an OS and I want to put some

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.