This repository has been archived by the owner on Feb 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 309
Dynamic · Matte Layer
詹瞻在欢聚 edited this page Nov 11, 2019
·
10 revisions
You may add matte layers between elements just like this:
Or you may add masks above elements like this:
Now you can do it at SVGAPlayer V2.5.0.
You can download a sample file from SVGA-Samples to try.
- Draw a pureColor layer;
- Select the pureColor layer, add a mask above it;
- Draw a pureColor layer;
- Draw a masked shape layer;
- Set the masked layer as a matte for the pureColor layer;
You can download a sample file from SVGA-Samples to try.
// Setup a SVGAPlayer by yourself.
SVGAParser *parser = [[SVGAParser alloc] init];
[parser parseWithURL:[NSURL URLWithString:@"https://github.com/svga/SVGA-Samples/raw/master_aep/BitmapColorArea1.svga"] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
} failureBlock:nil];
[...aPlayer setImage:iconImage forKey:@"matte_EEKdlEml.matte"];
// or
[...aPlayer setImageWithURL:[NSURL URLWithString: @"https://i.imgur.com/vd4GuUh.png"] forKey:@"matte_EEKdlEml.matte"];
The imageKey
is the name of element, ask your designer tell you the element name.
For example, the layer element name is xck_basket
, imageKey
is xck_basket
. The element should always use English name, do not use Chinese or Japanese etc.