[SOLVED] How do I cut a sprite within a rectangle?

0 favourites
  • 5 posts
From the Asset Store
Help this cute Monster to cut and release the candy.
  • Hello team,

    I've created a sprite behind another one to simulate shadow. But I want to constraint this shadow within a rectangle (because of different background, so don't need shadow everywhere). The only solution I've found is to create two rectangle with Copy blend effect, and it cut the shadow, like this :

    Is there a possibility to do the contrary, ie constraint the shadow within a rectangle ? No found that.

    Thanks for advice, if any !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Yes, you need Destination In blend mode. See "Blend Modes" template in Construct 3.

    Another method is to paste your shadow onto a DrawingCanvas object (smaller in size).

  • Was most complicated in my head was I thinking.

    So :

    I was using many layers : one background, one shadow, but only one layer suffice : Background, put Shadow on it, Z Layer top. I use Source atop because I need some FX on Shadow.

    It's work, thank you !

    Maybe a question about Canvas : how to create object on it? I create object on a Layer, fine, then use Paste object, but they are already in Layer, I need to remove manually? Don't get the point…

  • Yes, you can "crop" an image using canvas. Say, your sprite is 500x500 px, you can set canvas to 300x300 px, paste the sprite on it, then destroy the sprite. And you end up with a cropped image on the canvas.

  • Ok ! Thanks you !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)