Texture2D: Clip / Trim / Crop

Texture2D: Clip / Trim / Crop

Is there a fine way to do this programatically?
Can someone help and point me to the right doc / direction?


Hi ! You can use ClippingNode !


There is no such thing.
I am using Cocos Creator 2.0.9 and 2.1.1. I really need to cut down images…


Why not use a Mask?


Because I need to cut texture dynamically in multiple places and cut it into multiple sprite frames. The mask cannot do that


RenderTexture can be used in many ways to achieve this concept

Create object with size you want, render whatever you want inside the object, use the getSprite method.


Thank you. I will try. Is it available on 2.0.9 and 2.1.1?


I dont have a getSprite method inside the RenderTexture…