xcode7 - How to change color of pixels of an SKSpriteNode that go over a specific color? -
i'm not sure if title question clear take skspritenode
(or maybe skshapenode
) , make whenever moves on specific region of background has specific color, changes color of pixels on top specified color.
so example, if do:
let blackbox = skspritenode(texture: nil, color: uicolor.blackcolor(), size: cgsizemake(100, 100)) blackbox.position = cgpointmake(cgrectgetmidx(self.frame), cgrectgetmidy(self.frame)) blackbox.zposition = 5 self.addchild(blackbox) let redbox = skspritenode(texture: nil, color: uicolor.redcolor(), size: cgsizemake(100, 100)) redbox.position = cgpointmake(cgrectgetmidx(self.frame) + 50, cgrectgetmidy(self.frame) + 50) redbox.zposition = 4 self.addchild(redbox)
as can see blackbox on top of redbox since has higher zposition
it's not covering since position of redbox northeast
. in case blackbox full , redbox covered on bottom left quadrant. make portion of blackbox on top of uicolor.redcolor()
pixels (ie top right quadrant of blackbox) change color...say blue example? how program blackbox node update color of pixels depending on color behind it?
thanks in advance! :)
Comments
Post a Comment