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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:37:18+00:00 2026-05-21T07:37:18+00:00

OK guys fine…, seems like I was wrong from the last question… I’m working

  • 0

OK guys fine…, seems like I was wrong from the last question…

I’m working on a wordsearch game, and I’ve changed the “Point of View” of my app implementation from GridView to Bitmap-drawing using canvas in android.

this is the case:
there’s a drawable object inside a canvas and also another drawable object that will be draw as the user invoke the OntouchListener event…

I want to make a logic operation so that if the second draw object have the same axis or ordinat as the first drawable object, it will do something…

here’s the code:

public class DrawView extends View implements OnTouchListener{
private static final String TAG = "DrawView";

List<Point> points = new ArrayList<Point>();
Paint paint = new Paint();
Bitmap kangoo = BitmapFactory.decodeResource(getResources(),R.drawable.icon);

public DrawView(Context context, AttributeSet attrs) {
    super(context,attrs);
    setFocusable(true);
    setFocusableInTouchMode(true);

    this.setOnTouchListener(this);
    paint.setColor(Color.WHITE);
    paint.setAntiAlias(true);
}

@Override
public void onDraw(Canvas canvas) {
    Bitmap krazy = BitmapFactory.decodeResource(getResources(),R.drawable.schema);
    canvas.drawBitmap(krazy, 130, 130, null);
    for (Point point : points) {
        canvas.drawBitmap(kangoo, point.x, point.y, null);
        //canvas.drawCircle(point.x, point.y, 5, paint);
        // Log.d(TAG, "Painting: "+point);
    }
}

@Override
public boolean onTouch(View view, MotionEvent event) {
     // if(event.getAction() != MotionEvent.ACTION_DOWN)
    // return super.onTouchEvent(event);
    Point point = new Point();
    point.x = event.getX();
    point.y = event.getY();
    points.add(point);
    invalidate();
    Log.d(TAG, "point: " + point);
    return true;
}
    }

    class Point {
    float x, y;

    @Override
     public String toString() {
       return x + ", " + y;
     }
    }

see…, the static draw object is KRAZY and dynamic which will be draw while touch the screen is KANGOO

I want to know if those two object are in contact either by x or y….

Thank U

  • 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-21T07:37:19+00:00Added an answer on May 21, 2026 at 7:37 am

    Actually this solution is used to assist my word-search game project…

    The main thing that I just need to do is to measure the occupied words which represented by drawables blocks of string…
    and then to compare it with the square area that will be make by the square selection box which will draw itself inside the characters blocks as long as the user touch the screen…

    and then invoke when the square area or the occupied area of square selection is OCCUPIED by the entire characters block….
    i mean the square selection box is inside the characters blocks

    in this case if a word make 4 blocks of characters start from point.x=0.0 , y=0.0 , and each block occupied 32pix H and W then the square selection box occupied position must be less than 4*32(W) and 1*32(H)….

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

Sidebar

Related Questions

Hey guys, the following snippet of jQuery code seems to work fine in Google
Hey guys, so I've got my NSFetchedResultsController working fine under the 3.1 SDK, however
Hi guys I'm in an emergency here. My code was working FINE for a
hey guys i want to fetch 3 tables in 1 single ado.net call from
Hi guys I'm working on a google apps application. Basically I've set it up
hey guys, i have downloaded mondor's captcha control, and implemented on localhost, thats working
Hi guys i am working on drag and drop event in android via jquery
Hey guys I am making a 2D game and I have generating a random
guys i am having a text like this: A: hi how are you. B:
Hiya guys heres my question: im using mootools and im using this demo-> Drag.Move

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.