How can I get the color value of a SKSpriteNode or SKTexture at a pixel offset?
let atlas = SKTextureAtlas(named: "SomeAtlas")
let texture = atlas.textureNamed("SomeTexture")
let node = SKSpriteNode(texture: texture)
// Something like this...
let pixel: SKColor = node.pixelAtPoint(x: 30, y: 100)
If I were writing direct OpenGL I'd just load my texture into a framebuffer and use glReadPixels
, but I can't seem to get that sort of low-level access in SpriteKit...