Can I define the collision box at runtime?

Get help using Construct 2

Post » Wed Jul 31, 2013 9:56 pm

I have to create 60+ items, each with 4-6 frames each (not animated, just toggling between images)...

Each object has:

1. At rest
2. Dragging
3. Dropped
4. At rest (easy mode)
5. Dragging (easy mode)
6. Dropped (easy mode)


They are going to be dragged and dropped and as it's possible for the entire object to be over more than one drop zone, I need to indicate the "pointer" part of the image (frames 2 and 5) to be what makes a drop zone active... like the upper left corner 10x10 pixels.

I can do it manually and it works just fine. However, if I create these 60 images I then have to manually edit the bounding boxes for 120 frames. Not a big deal, but if I reload the source images, they get overwritten.

So is there a way to create a collision box at run time?

FYI, I wanted to make a single item and create copies, but I could never get the text to look right on them, so I have to go back to graphics for this. Attaching the text to an image via Container just wasn't cutting it as the text kept having to be manually moved each time the object was moved and when physics gets involved the text was just flying around like crazy (eventually reconnecting).

However, the fonts still looked awful and varied based on the test platform. I don't want to have to be online so webfonts wouldn't work either.
B
22
S
4
G
1
Posts: 100
Reputation: 2,150

Post » Wed Jul 31, 2013 10:09 pm

You can't change the collision poly at runtime, but depending on your situation there might be a more efficient way to do this.

Are all 60+ items quite distinct in their shape and desired collision polygons? If not, you're much better off using a single collision detection object that's duplicated for each item.
B
57
S
15
G
11
Posts: 912
Reputation: 12,596

Post » Wed Jul 31, 2013 10:29 pm

Perfect!!!! Thanks!
B
22
S
4
G
1
Posts: 100
Reputation: 2,150


Return to How do I....?

Who is online

Users browsing this forum: tikuna and 10 guests