# Overlapping position

Get help using Construct 2

### » Mon Jan 20, 2014 5:10 pm

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 will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

### » Mon Jan 20, 2014 5:19 pm

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....
B
21
S
9
Posts: 298
Reputation: 2,972

### » Mon Jan 20, 2014 5:32 pm

No,it's not like that,the two sprites are overlapping at an angle.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

### » Mon Jan 20, 2014 5:46 pm

The upsidedown image should be scaled to reach the overlapping position every second.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

### » Mon Jan 20, 2014 10:49 pm

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 https://en.wikipedia.org/wiki/Lens_%28optics%29 that can directly give the x.cord of the point.

B
16
S
4
G
2
Posts: 233
Reputation: 2,560

### » Tue Jan 21, 2014 9:25 am

ok.I'll try.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

### » Tue Jan 21, 2014 4:50 pm

I've used maths and this is the result.I don't know what's wrong here.The maths is right.I am sure.
http://www.2shared.com/file/_gZc3TlD/Lens_-_Copy.html
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

### » Tue Jan 21, 2014 6:31 pm

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.

https://www.dropbox.com/s/0ckrhcrlu3cmqi3/Lens2.capx Joannak2014-01-21 18:59:09
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

### » Thu Jan 23, 2014 11:03 am

@Joannak
That file doesn't work on r152
How do I upload it to web?I want it to be HTML5.
I will not let you reach the sisters
Nature Forums
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

### » Thu Jan 23, 2014 11:32 am

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.

Joannak2014-01-23 11:34:20
B
16
S
4
G
2
Posts: 233
Reputation: 2,560

Next