objective c - regionByIntersectionWithRegion: not working in Sprite Kit -
i'm trying use spritekit skregion class compute intersection, difference, union of closed cgpaths, doesn't seem working. here simple example expect work nothing rendered here.
cgpathref = cgpathcreatewithellipseinrect(cgrectmake(0, 0, 100, 100), null); cgpathref b = cgpathcreatewithellipseinrect(cgrectmake(50, 0, 100, 100), null); skregion *ra = [[skregion alloc] initwithpath:a]; skregion *rb = [[skregion alloc] initwithpath:b]; skregion *rc = [ra regionbyintersectionwithregion:rb]; cgpathref c = [rc path]; cgcontextref context = (cgcontextref)[[nsgraphicscontext currentcontext] graphicsport]; cgcontextaddpath(context, c); cgcontextfillpath(context);
rendering a
, b
works, nothing appears c
although these circles overlap.
other scenarios fail work well, such using basic rectangles , b, or using different skregion constructors don't operate on paths.
any ideas?
if try render ra.path, need use high values same size circles. used 3000 instead of 100 , way see circles.
for reason rc nil so, must bug or beta feature.
Comments
Post a Comment