Hello everyone,
I'm trying to "split" a sprite into two separate entities, as if I were to cut across one with a knife. This would be a fairly easy problem if I could allocate new images for each split, but since I want this to happen for several sprites at once, all using the same texture, allocating several pairs of new images seems very silly and inefficient. This is a visual example of what I'm trying to accomplish:
The red line across which the sprite is split could be at any angle (and hopefully in the future multiple lines, like a jagged line), and the two images in the third panel would be separate and independent.
I feel like the use of texture coordinates would simplify what I'm doing, but I haven't gone source-diving into SFML enough to know what modifications I would make, and I wanted to see if there's an easy way to do this that I'm overlooking. I can't create a pixel mask, since that would allocate a new image, but maybe I could make some sort of simple vector mask using sf::Shape?
If anyone could provide any general suggestions, references, or hints, that would be fantastic. Thanks in advance!