SKCropNode masking edge anti-aliasing

前端 未结 3 1355
旧巷少年郎
旧巷少年郎 2021-01-02 00:38

I created a circular mask and animate a sprite inside the mask by using sprite kit SKCropNode class. But the edge of the mask looks pixellated.

Is there a way to use

3条回答
  •  轮回少年
    2021-01-02 00:58

    From the official docs:

    If the pixel in the mask has an alpha value of less than 0.05, the image pixel is masked out.

    So, SKCropNode doesn't support per pixel alpha values. It either draws the pixels or it doesn't. If alpha (as is used by anti-aliasing) is important to you, you should consider alternative routes. For example:

    How to Mask an UIImageView

提交回复
热议问题