CreateJS / TweenJS

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.
http://createjs.com/
MIT License
3.56k stars 966 forks source link

clip #112

Open yuanhaotian opened 3 years ago

yuanhaotian commented 3 years ago

Can you cut graphics in createjs?like the clip() of the native canvas

danzen commented 3 years ago

@yuanhaotian - yes - there is a sourceRect property of the Bitmap class https://createjs.com/docs/easeljs/classes/Bitmap.html#property_sourceRect or you can make a mask with a Shape. We add the width, height, left and top as parameters to a ZIM Bitmap() which extends a CreateJS Bitmap - https://zimjs.com/docs.html?item=Bitmap to make things easier - but that is in ZIM.