Please help. Canvas Coordinate information

by chris harper » Tue, 16 Mar 2010 04:44:37 GMT

Sponsored Links
 Any help would be great on this thank you.

If you have two objects on the canvas (obj A) (obj B) and they both
move around dynamically (i.e the X,Y values are constantly changing).

I need to check if they intersect.

I know you can do something like ObjA.X == ObjB.X && and ObjA.Y ==
ObjB.Y but the objects are complex (i.e made up of multiple images and
x,y positions for each).
So constantly checking track of every single x,y position for Obj A
and checking it against every x,y image position of Obj B is a lot of
overhead for each redraw.

My question then is there a better way to do this? For example can you
some how get information from the canvas of position x,y and tell if
there is another image set to that position already? Then each object
can just check it's own x,y position to see if "intersects" with
another object (whatever it might be)? I mean it makes sense that if
you draw Obj A at X,Y the canvas knows about it, so Obj B should be
able to get that information?

Is this possible somehow? I been checking the libs and I have not
found anything yet.

Or if anyone else has any ideas of checking dynamically changing
object positions and intersections between them I am welcome to any

Or am I stuck with keeping track and comparing every x,y for each
object on every iteration?

Thank you for any help


Other Threads

1. CLosed: OOT: WTA AXIS bocor?

oke deh om Dedi,
makasih banyak yah.
besok pagi saya coba beli lagi deh...
*diclosed aja yah*

2010/5/10 Dedi Sopian <>

>> > 

2. opencore regression test -logfile and other options

Hi Community,
I'm trying to regression-test opencore's pvplayer_engine_test
executable; that is, running some of the available tests and
outputting the maximum amount of reproduceable information (Avoiding
Time and Memory Addresses in the output.) so that I can "diff" the
output of two runs. The goal is to automatically check that nothing
was broken from one run to the other.

1. What are the best available options for that purpose?
2. I need to output the result to a file and "-logfile myfile" does
not seem to work: "myfile" does not get created. Am I using the wrong

Thank you for helping


3. Set an ImageView at a particular position inside GridView

4. porting liboverlay

5. How can I know if OpenGl has drawn something?

6. Lots of lost sales due to Credit Card authorization.

7. Eclipse: running junit tests