Bounding box points coords.

Discussion and feedback on Construct 2

Post » Thu Jul 14, 2016 7:27 pm

Hello, does anyone know if there is any way to access the coordinates where the points of collision box ?.

For example, suppose that my character has a bounding box with 4 points, then I could refer to these points as follows:

For the first point
sprite.boundingBoxX (1)
sprite.boundingBoxY (1)

For the second point
sprite.boundingBoxX (2)
sprite.boundingBoxY (2)

I mean these points

Image

I need to know if any of these points are within an area on the map.
B
29
S
12
G
21
Posts: 801
Reputation: 14,453

Post » Thu Jul 14, 2016 8:07 pm

@Mirlas
I don't believe it is possible to access the points of the collision box - but what I have done in similar circumstances is use an invisible square sprite, and position in over an image point. Then you can calculate the coordinates of that sprite to see if it is within the target area.
B
96
S
33
G
20
Posts: 438
Reputation: 17,665

Post » Thu Jul 14, 2016 8:11 pm

If they are the same as the boundingbox, you can calculate them with the BBox... expressions.

Dont think you can acces them them straight forward.

What about setting imagepoints ?

Maybe this plugin ? plugin-polygon-update-2013-04-23_t77970
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jul 14, 2016 8:42 pm

@AllanR
@99Instances2Go

Thanks guys, I did not think to use image points but it sure helps me with that.
:P
B
29
S
12
G
21
Posts: 801
Reputation: 14,453

Post » Fri Jul 15, 2016 6:54 am

Also, not as nice as @99Instances2Go 's solution, but you can create an invisible dummy object for those areas you want to check and use the "Is overlapping another object" event.
B
135
S
33
G
17
Posts: 1,557
Reputation: 20,717


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 14 guests