Documentation Archive Developer
Search

SpriteKit Changes for Swift

SpriteKit

Removed SKTexture.CGImage
Modified SKTexture
Declaration
From
class SKTexture : NSObject, NSCopying, NSCoding {
    convenience init(imageNamed name: String)
    class func textureWithImageNamed(_ name: String) -> Self
    convenience init(rect rect: CGRect, inTexture texture: SKTexture)
    class func textureWithRect(_ rect: CGRect, inTexture texture: SKTexture) -> Self
    convenience init(vectorNoiseWithSmoothness smoothness: CGFloat, size size: CGSize)
    class func textureVectorNoiseWithSmoothness(_ smoothness: CGFloat, size size: CGSize) -> Self
    convenience init(noiseWithSmoothness smoothness: CGFloat, size size: CGSize, grayscale grayscale: Bool)
    class func textureNoiseWithSmoothness(_ smoothness: CGFloat, size size: CGSize, grayscale grayscale: Bool) -> Self
    convenience init(CGImage image: CGImage)
    class func textureWithCGImage(_ image: CGImage) -> Self
    convenience init(image image: UIImage)
    class func textureWithImage(_ image: UIImage) -> Self
    convenience init(data pixelData: NSData, size size: CGSize)
    class func textureWithData(_ pixelData: NSData, size size: CGSize) -> Self
    convenience init(data pixelData: NSData, size size: CGSize, flipped flipped: Bool)
    class func textureWithData(_ pixelData: NSData, size size: CGSize, flipped flipped: Bool) -> Self
    convenience init(data pixelData: NSData, size size: CGSize, rowLength rowLength: UInt32, alignment alignment: UInt32)
    class func textureWithData(_ pixelData: NSData, size size: CGSize, rowLength rowLength: UInt32, alignment alignment: UInt32) -> Self
    func textureByApplyingCIFilter(_ filter: CIFilter) -> Self
    func textureByGeneratingNormalMap() -> Self
    func textureByGeneratingNormalMapWithSmoothness(_ smoothness: CGFloat, contrast contrast: CGFloat) -> Self
    func textureRect() -> CGRect
    func size() -> CGSize
    var filteringMode: SKTextureFilteringMode
    var usesMipmaps: Bool
    var CGImage: CGImage { get }
    class func preloadTextures(_ textures: [SKTexture], withCompletionHandler completionHandler: () -> Void)
    func preloadWithCompletionHandler(_ completionHandler: () -> Void)
}
extension SKTexture : _Reflectable {
}
extension SKTexture : _Reflectable {
}
To
class SKTexture : NSObject, NSCopying, NSCoding {
    convenience init(imageNamed name: String)
    class func textureWithImageNamed(_ name: String) -> Self
    convenience init(rect rect: CGRect, inTexture texture: SKTexture)
    class func textureWithRect(_ rect: CGRect, inTexture texture: SKTexture) -> Self
    convenience init(vectorNoiseWithSmoothness smoothness: CGFloat, size size: CGSize)
    class func textureVectorNoiseWithSmoothness(_ smoothness: CGFloat, size size: CGSize) -> Self
    convenience init(noiseWithSmoothness smoothness: CGFloat, size size: CGSize, grayscale grayscale: Bool)
    class func textureNoiseWithSmoothness(_ smoothness: CGFloat, size size: CGSize, grayscale grayscale: Bool) -> Self
    convenience init(CGImage image: CGImage)
    class func textureWithCGImage(_ image: CGImage) -> Self
    convenience init(image image: UIImage)
    class func textureWithImage(_ image: UIImage) -> Self
    convenience init(data pixelData: NSData, size size: CGSize)
    class func textureWithData(_ pixelData: NSData, size size: CGSize) -> Self
    convenience init(data pixelData: NSData, size size: CGSize, flipped flipped: Bool)
    class func textureWithData(_ pixelData: NSData, size size: CGSize, flipped flipped: Bool) -> Self
    convenience init(data pixelData: NSData, size size: CGSize, rowLength rowLength: UInt32, alignment alignment: UInt32)
    class func textureWithData(_ pixelData: NSData, size size: CGSize, rowLength rowLength: UInt32, alignment alignment: UInt32) -> Self
    func textureByApplyingCIFilter(_ filter: CIFilter) -> Self
    func textureByGeneratingNormalMap() -> Self
    func textureByGeneratingNormalMapWithSmoothness(_ smoothness: CGFloat, contrast contrast: CGFloat) -> Self
    func textureRect() -> CGRect
    func size() -> CGSize
    var filteringMode: SKTextureFilteringMode
    var usesMipmaps: Bool
    func CGImage() -> CGImage
    class func preloadTextures(_ textures: [SKTexture], withCompletionHandler completionHandler: () -> Void)
    func preloadWithCompletionHandler(_ completionHandler: () -> Void)
}
extension SKTexture : _Reflectable {
}
extension SKTexture : _Reflectable {
}