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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:47:21+00:00 2026-05-26T06:47:21+00:00

I am developing a Car Race Game. I am able to move, stop, accelerate.

  • 0

I am developing a Car Race Game. I am able to move, stop, accelerate. But i want that when i press screen then car(bitmap of car image) should look like, it had jumped on its place.I am using surfaceviewto draw view

I do not want to use 3D openGL. Any help is much appreciated

  • 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-26T06:47:21+00:00Added an answer on May 26, 2026 at 6:47 am

    finally i used.On touch event, i create a bigger bitmap and draw it on same place. So it will give zoom effect

    Bitmap bitmapToZoom;  // Create a Bitmap
    // Now zoom it 
    bitmapToZoom=Bitmap.createScaledBitmap(bitmapToZoom, bitmapToZoom.getWidth()+30,bitmapToZoom.getHeight()+30, null); 
    //now draw it again
    canvas.drawBitmap(bitmapToZoom, 0,0,null);
    

    So now finally, Zooming actor on touch code will be like this. Class Name ZoomonTouc.java

    import android.content.Context;
    import android.graphics.Bitmap;
    import android.graphics.BitmapFactory;
    import android.graphics.Canvas;
    import android.graphics.RectF;
    import android.view.MotionEvent;
    import android.view.SurfaceView;
    
    public class ZoomonTouc extends SurfaceView {
    public Bitmap mMyChracter;
    
    public ZoomonTouc(Context context) {
        super(context);
        mMyChracter = BitmapFactory.decodeResource(context.getResources(),
                R.drawable.ic_launcher);
        setWillNotDraw(false);
    }
    
    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        canvas.drawBitmap(mMyChracter, mMyChracter.getWidth()/2, mMyChracter.getHeight()/2, null);
        invalidate();
    }
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        RectF rectF = new RectF(mMyChracter.getWidth()/2, mMyChracter.getHeight()/2, mMyChracter.getWidth() + 100,
                mMyChracter.getHeight() + 100);
        if (rectF.contains(event.getX(), event.getY())) {
            mMyChracter = Bitmap.createScaledBitmap(mMyChracter,
                    mMyChracter.getWidth() + 10, mMyChracter.getHeight() + 10,
                    false);
        }
        return true;
    }
    

    }

    To test it properly create one activity and set above surface to activity background

    setContentView(new ZoomonTouc(this));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue with an application that I'm developing for a car pooling
This is the scenario i have: im developing a web app that will list
Developing rails has become lots of fun over the year that I've done it,
Developing for iPhone, I have a collection of points that I need to make
I have this web page I'm developing that displays multiple images of one product
I am about to add Game Kit functionality to a game I am developing.
Developing with my first Mac and I noticed that my Rspec output isn't colorized
Developing a network application, I have a Connection class that manages sending and receiving
I am developing code for the map view in iphone where I was able
Developing a simple game for the iPhone, what gives a better performance? Using a

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.