ios - Strange black border when using SKCropNode -


i'm working on game spritekit , have square skspritenode corners want make round. can't use skshapenode because want add gradient it. decided use skcropnode crop it, when so, weird black border appears:

enter image description here

if don't try crop it, looks this:

enter image description here

this code using create , crop it:

    spritenode = skspritenode(color: color.skcolor, size: cgsize(width: tilesize, height: tilesize))      let borderradius: cgfloat = 2     let roundpath = cgpathcreatewithroundedrect(cgrect(x: -tilesize / 2, y: -tilesize / 2, width: tilesize, height: tilesize), borderradius, borderradius, nil)      let mask = skshapenode()     mask.path = roundpath     mask.fillcolor = skcolor.whitecolor()     mask.strokecolor = skcolor.whitecolor()      let cropnode = skcropnode()     cropnode.masknode = mask      let shadow = skspritenode(color: skcolor.blackcolor(), size: cgsize(width: tilesize, height: tilesize))     shadow.colorblendfactor = 1     shadow.alpha = 0.25      let radius: cgfloat = 3.5     shadow.position = cgpoint(x: radius / 2, y: radius / 2)      let effectnode = skeffectnode()     effectnode.filter = cifilter(name: "cigaussianblur", withinputparameters: [kciinputradiuskey: radius])     effectnode.zposition = spritenode!.zposition - 1     effectnode.addchild(shadow)      let bluredtile = skshapenode(path: roundpath)     bluredtile.addchild(effectnode)      cropnode.addchild(spritenode!)      addchild(bluredtile)     addchild(cropnode) 

why happening, , how can stop it?


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -