I'm trying to create a SKSpriteNode from a 2D-Array of RGBA objects which represents the pixels in a image I want to create. But I don't know how to do it, and I searched for tutorials and could not find one.
For example:
struct RGBA {
var r: UInt8
var g: UInt8
var b: UInt8
var a: UInt8
}
let pixelData: [[RGBA]] = ...
function CreateSKSpriteNodeFromPixelData(data: [[RGBA]]) -> SKSpriteNode {
//......What goes on here?
}
Thank you very much for your help!