# Overlapping position

0 favourites
• 20 posts
• In this .capx, :http://www.2shared.com/file/ta9Cdncq/Overlaps_point.html

,

The "LineChange" and "LineAngle" overlaps at different positions.I want to know where(X and Y position) they are overlapping.This is a little confusing so please have a look at the capx.

• I can't open the file (I need to register on the website...) but you can compare a "distance(sprite.X,sprite.Y, sprite2.X,sprite2.Y)"...

for example, if you like to make some event if some sprite overlapping but more close, or in different position, you can compare the distance....

No,it's not like that,the two sprites are overlapping at an angle.

• The upsidedown image should be scaled to reach the overlapping position every second.

• Looks like optics test, image making with convex lens?

For me it looks like: For this particular need, you'll just have to resort using some real math. Since you know the angles and zero-Y crossings (the blue line) of each red lines, finding the image point it's not hard math at all.

If you'll know the focal distance, there's thin-lens formula at en.wikipedia.org/wiki/Lens_%28optics%29 that can directly give the x.cord of the point.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads
• ok.I'll try.

• I've used maths and this is the result.I don't know what's wrong here.The maths is right.I am sure.

2shared.com/file/_gZc3TlD/Lens_-_Copy.html

• Well. X-pos of the arrow looks to be just ok to me. Y-size is somewhat out, and I have to say that reading the equations ain't the easiest.

AHA..

Problem is that your RealImage -sprite has some extra transparent pixels at the top of the image. Image size is higher than the visible area, thus the scaling fails.

Use "crop transparent edges" at the image editor. That seems to image length.

Also.. You can just delete subevents 11 and 12 .. those are not needed at all. Actually it works better without them.

dropbox.com/s/0ckrhcrlu3cmqi3/Lens2.capx

• Sorry for the late reply.

That file doesn't work on r152

How do I upload it to web?I want it to be HTML5.

• You are still using R152? That's quite old. I'd recommend you to download the latest Stable R158.2

To upload your code, firstly you need to make suitable version for web use.

• From the upcoming window, choose HTML-5 and then select where to save the files.

-> Construct will automatically make Index.html and necessary files.

After that, you should need to upload those exported files to some site where others can see them.

• Joannak,sorry Its 158.the 158.2 is just a bug fix for Iphones or somethi ng.

Okay.Thanks

• Well. I'm not sure if the versions are 100% compatible. And if the file don't open, it's most likely due different version of C2 ..