Dynamic way to cut sprite in half?

Discussion and feedback on Construct 2

Post » Fri Mar 14, 2014 6:58 am

Is there a dynamic way to cut a sprite in half? Meaning, WITHOUT using either of the following:
- Manually cutting them in half and creating animation frames
- Piecing two halves together using the pin method, then using unpin to cut in half
- Create a 2 new sprites, each containing one half and create it on top of the original sprite

Is there any method, like dynamically copying part of an image onto another sprite?

I have about 100 vehicles/sprites already created for an RTS game--when a unit is destroyed, I want to create an animation of the vehicle breaking into 2 halves. But to go back and create a "splitting animation" sprites for all 100 vehicles would probably take another month. Is there a faster, more dynamic/run-time way to do this?
Posts: 19
Reputation: 353

Post » Fri Mar 14, 2014 8:10 am

If the collision mask is not important and all you need is to split the graphics, you can use a mask object.

Create 2 mask objects (color the unwanted parts in black the rest leave transparent) and set the blending mode to Destination out

On the layer settings where the object is on set:
1. Transparent YES
2. Force own texture YES

Now create 2 instances of your object and the 2 masks and pin them to the object.
If the mask is the same on both sides you can just mirror the same mask.
Posts: 515
Reputation: 12,384

Return to Construct 2 General

Who is online

Users browsing this forum: lukewasthefish and 6 guests