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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:45:02+00:00 2026-06-10T10:45:02+00:00

In the game I’m developing I need this function: being able to draw on

  • 0

In the game I’m developing I need this function: being able to draw on the screen and to establish if the drawing is a determined shape (let’s say a rectangle, triangle or whatever).

So I wanted to use gestures, which are the easier way to do that; with the gesture builder I made a few shapes and I use them as models. The thing is, I can’t make it work with the AndEngine.

I need the GestureOverlayView, which is basically the drawing board, to be placed ON TOP of the scene of the game, so that I can see the scene itself with all the entities attached and I can also draw gesture.

Right now what I tried didn’t work, either the AndEngine stuff is shown on screen or the GestureOverlayView is, not both.

I’m new both with android developing and the AndEngine, so I’m kinda stuck here… do you have any ideas on how could I make it work? I looked everywhere but I can’t find anything useful…

I’ll leave the code of the gesture part below just for example, it won’t really work obviously if you don’t have any pre-made gestures in the path res/raw of the project:

public class ProvaGesture extends Activity implements GestureOverlayView.OnGesturePerformedListener        
{

     private GestureLibrary gestureLib;

     public  GestureOverlayView gestureOverlayView;


     @Override
     public void onCreate(Bundle savedInstanceState) 
     {
          super.onCreate(savedInstanceState);

          gestureOverlayView = new GestureOverlayView(this);

          gestureOverlayView.addOnGesturePerformedListener(this);

          gestureLib = GestureLibraries.fromRawResource(this, R.raw.gestures);

          if (!gestureLib.load())
          {
                finish();
          }

           setContentView(gestureOverlayView);
      }


     public void onGesturePerformed(GestureOverlayView overlay, Gesture gesture)
     {
           ArrayList<Prediction> predictions = gestureLib.recognize(gesture);

           for (Prediction prediction : predictions) 
           {
                 if (prediction.score > 1.0) 
                 {
                        Toast.makeText(this, prediction.name, Toast.LENGTH_SHORT).show();
                 }
           }
     }


}
  • 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-10T10:45:04+00:00Added an answer on June 10, 2026 at 10:45 am

    I didn’t see AndEngine part in your demo code. Your ProvaGesture activity should be extended from AndEgine’s SimpleBaseGameActivity or BaseGameActivity then implements IOnSceneTouchListener.

    Base on your idea, I guessed that you try to create a separated overlay view which handles only the gesture, so you must consider:

    • You have only one activity running at a time in android.

    • If you want to create an User-defined view overlaping the AndEgine’s surface view, you should see Andengine’s example: XMLLayoutExample.

    The solution may be [suggested]:

    public class OverlapLayoutExample extends SimpleLayoutGameActivity {
    @Override
    protected int getLayoutID() {
        //your layout id (xml file in layout folder)
        return R.layout.overlaplayout;
    }
    
    @Override
    protected int getRenderSurfaceViewID() 
    {
        //overlaplayout will contain a SurfaceView with following ID
        //this surface is where you render Andgine
        return R.id.overlaplayout_rendersurfaceview;
    }
    }
    

    Don’t forget to create your own layout: overlaplayout containing surfaceView and OverlayView

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

Sidebar

Related Questions

Game.prototype.run = function() { window.setInterval(function() { var thisLoop = new Date().getTime(); this.update(); this.render(); lastLoop
My game normally uses GL_TEXTURE_RECTANGLE_EXT to draw 2D textures. However, since this isn't supported
The game I'm developing renders perfectly on the Java backend and on IE 10.
I write game. I use RequestWindowFeature(WindowFeatures.NoTitle); at splash screen, but how can I disable
So I have this game database, where I have several users with fields, id,
//Handle game logic mcPlayer.update(); //create question mcMathQu.update(); the first update function of external as
I am porting a game using SpiderMonkey to Android. Because I need to integrate
I am developing a Game and I didn't want an array full of levels
Game.java calls a function getLabel() present in board.java. When I am running Game.java, I
Multuplayer game with socket.io - Make the bigger word from letters How need to

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.