Guess Polygon Shape during Runtime

Get help using Construct 2

Post » Tue Oct 15, 2013 5:53 pm

Hi,

is there any way to do this?

Many thanks :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Thu Jan 16, 2014 4:11 pm

Hello!

I have the same problem. I need to know if there's a way to do this.

Thank you.
B
3
Posts: 8
Reputation: 241

Post » Thu Jan 16, 2014 4:25 pm

What is the problem exactly?

You'd like to guess a polygon during runtime.
Do you mean a collision polygon?
How should the polygon be guessed?
Why should it be guessed during runtime?
After it's been guessed what would you like to do with the polygon?

Some more information about the question will make answering it a lot easier.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jan 17, 2014 11:25 am

Hi again!

Thanks for your answer.

You know the option we have inside the sprite editor in C2 that says "Guess polygon shape" and then he creates a collision polygon trying to adequate it to the shape of the picture? I'd like to know if there's a way to call this as an action in an event, more accurately as an action of the "On image URL loaded" event.

A have a bank of images in the game which the user will only see as miniatures, and then he can choose which ones he would like to add to the scene, and then those will appear bigger and with better resolution. The problem is that the bank is very large, there's a ton of pictures, and so far I'm caught between 2 choices:

1) Putting all of these pictures along with the project. That will cause it to be very heavy, and as the internet here is very poor in speed, it'll be bad for the people trying to play it and bad for our product as well.

2) Loading only the images that the user chooses during runtime. But as the pictures will interact with each other I can't afford to have the collision set to the sprite bounding box, as the images have all sorts of different shapes. If I could apply the "Guess polygon shape" right after loading it, that would solve it because when I do it manually in C2 it ignores the transparency around the image quite well.

Thank you for your time.
Cheers!
B
3
Posts: 8
Reputation: 241

Post » Fri Jan 17, 2014 2:09 pm

@edgaredgar

Have you considered using separate sprite object(s) specifically for collision? Each potential collision polygon would need to be programed in, but it would give you more flexibility without a huge file size increase.
B
64
S
19
G
8
Posts: 341
Reputation: 12,185

Post » Tue Jan 21, 2014 10:45 am

Thank yout for reply, but are many objects, I needed something more practical.

B
3
Posts: 8
Reputation: 241

Post » Sun Apr 13, 2014 5:33 am

Long time this thread is on, but any solution came across with the latest updates?

The aim is to destroy only parts of an object, and leave a transparent area (maybe after being hit by a bullet)

For the variant of using the canvas addon, currently I could not figure out how I could delete an area of a graphic via "mask" of the bullet explosion.

Any ideas welcome :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests