One Logo Pool Ball
SpriteKit · IOS API REFERENCE

SKSpriteNode

class · SDK 27.1

class SKSpriteNode

Members (38)

init

init

TypeScript
static initImageNamedNormalMapped(name: string, generateNormalMap: boolean): Promise<SKSpriteNode>
Swift declaration
convenience init(imageNamed name: String, normalMapped generateNormalMap: Bool)
init

init

TypeScript
static initTextureNormalMap(texture?: (SKTexture) | null, normalMap?: (SKTexture) | null): Promise<SKSpriteNode>
Swift declaration
convenience init(texture: SKTexture?, normalMap: SKTexture?)
init

init

TypeScript
static initTextureSize(texture: (SKTexture) | null, size: { width: number; height: number }): Promise<SKSpriteNode>
Swift declaration
convenience init(texture: SKTexture?, size: CGSize)
init

init

TypeScript
static initCoder(aDecoder: _Foundation_NSCoder): Promise<(SKSpriteNode) | null>
Swift declaration
init?(coder aDecoder: NSCoder)
init

init

TypeScript
static initColorSize(color: _UIKit_UIColor, size: { width: number; height: number }): Promise<SKSpriteNode>
Swift declaration
convenience init(color: UIColor, size: CGSize)
init

init

TypeScript
static initImageNamed(name: string): Promise<SKSpriteNode>
Swift declaration
convenience init(imageNamed name: String)
init

init

TypeScript
static initTexture(texture?: (SKTexture) | null): Promise<SKSpriteNode>
Swift declaration
convenience init(texture: SKTexture?)
init

init

TypeScript
static initTextureColorSize(texture: (SKTexture) | null, color: _UIKit_UIColor, size: { width: number; height: number }): Promise<SKSpriteNode>
Swift declaration
init(texture: SKTexture?, color: UIColor, size: CGSize)
method · iOS 10.0+

scale

TypeScript
scale(size: { width: number; height: number }): Promise<void>
Swift declaration
func scale(to size: CGSize)
method · iOS 10.0+

setValue

TypeScript
setValue(value: SKAttributeValue, key: string): Promise<void>
Swift declaration
func setValue(_ value: SKAttributeValue, forAttribute key: String)
method · iOS 10.0+

value

TypeScript
value(key: string): Promise<(SKAttributeValue) | null>
Swift declaration
func value(forAttributeNamed key: String) -> SKAttributeValue?
get

anchorPoint

TypeScript
get anchorPoint(): Promise<{ x: number; y: number }>
Swift declaration
var anchorPoint: CGPoint { get set }
set

anchorPoint

TypeScript
setAnchorPoint(value: { x: number; y: number }): Promise<void>
Swift declaration
var anchorPoint: CGPoint { get set }
get · iOS 10.0+

attributeValues

TypeScript
get attributeValues(): Promise<Record<string, SKAttributeValue>>
Swift declaration
var attributeValues: [String : SKAttributeValue] { get set }
set · iOS 10.0+

attributeValues

TypeScript
setAttributeValues(value: Record<string, SKAttributeValue>): Promise<void>
Swift declaration
var attributeValues: [String : SKAttributeValue] { get set }
get

blendMode

TypeScript
get blendMode(): Promise<SKBlendMode>
Swift declaration
var blendMode: SKBlendMode { get set }
set

blendMode

TypeScript
setBlendMode(value: SKBlendMode): Promise<void>
Swift declaration
var blendMode: SKBlendMode { get set }
get

centerRect

TypeScript
get centerRect(): Promise<{ x: number; y: number; width: number; height: number }>
Swift declaration
var centerRect: CGRect { get set }
set

centerRect

TypeScript
setCenterRect(value: { x: number; y: number; width: number; height: number }): Promise<void>
Swift declaration
var centerRect: CGRect { get set }
get

color

TypeScript
get color(): Promise<_UIKit_UIColor>
Swift declaration
var color: UIColor { get set }
set

color

TypeScript
setColor(value: _UIKit_UIColor): Promise<void>
Swift declaration
var color: UIColor { get set }
get

colorBlendFactor

TypeScript
get colorBlendFactor(): Promise<number>
Swift declaration
var colorBlendFactor: CGFloat { get set }
set

colorBlendFactor

TypeScript
setColorBlendFactor(value: number): Promise<void>
Swift declaration
var colorBlendFactor: CGFloat { get set }
get · iOS 8.0+

lightingBitMask

TypeScript
get lightingBitMask(): Promise<number>
Swift declaration
var lightingBitMask: UInt32 { get set }
set · iOS 8.0+

lightingBitMask

TypeScript
setLightingBitMask(value: number): Promise<void>
Swift declaration
var lightingBitMask: UInt32 { get set }
get · iOS 8.0+

normalTexture

TypeScript
get normalTexture(): Promise<(SKTexture) | null>
Swift declaration
var normalTexture: SKTexture? { get set }
set · iOS 8.0+

normalTexture

TypeScript
setNormalTexture(value?: (SKTexture) | null): Promise<void>
Swift declaration
var normalTexture: SKTexture? { get set }
get · iOS 8.0+

shader

TypeScript
get shader(): Promise<(SKShader) | null>
Swift declaration
var shader: SKShader? { get set }
set · iOS 8.0+

shader

TypeScript
setShader(value?: (SKShader) | null): Promise<void>
Swift declaration
var shader: SKShader? { get set }
get · iOS 8.0+

shadowCastBitMask

TypeScript
get shadowCastBitMask(): Promise<number>
Swift declaration
var shadowCastBitMask: UInt32 { get set }
set · iOS 8.0+

shadowCastBitMask

TypeScript
setShadowCastBitMask(value: number): Promise<void>
Swift declaration
var shadowCastBitMask: UInt32 { get set }
get · iOS 8.0+

shadowedBitMask

TypeScript
get shadowedBitMask(): Promise<number>
Swift declaration
var shadowedBitMask: UInt32 { get set }
set · iOS 8.0+

shadowedBitMask

TypeScript
setShadowedBitMask(value: number): Promise<void>
Swift declaration
var shadowedBitMask: UInt32 { get set }
get

size

TypeScript
get size(): Promise<{ width: number; height: number }>
Swift declaration
var size: CGSize { get set }
set

size

TypeScript
setSize(value: { width: number; height: number }): Promise<void>
Swift declaration
var size: CGSize { get set }
get

texture

TypeScript
get texture(): Promise<(SKTexture) | null>
Swift declaration
var texture: SKTexture? { get set }
set

texture

TypeScript
setTexture(value?: (SKTexture) | null): Promise<void>
Swift declaration
var texture: SKTexture? { get set }
get

customPlaygroundQuickLook

TypeScript
get customPlaygroundQuickLook(): Promise<SDKHandle>
Swift declaration
@MainActor @preconcurrency var customPlaygroundQuickLook: PlaygroundQuickLook { get }

A custom playground Quick Look for this instance. If this type has value semantics, the `PlaygroundQuickLook` instance should be unaffected by subsequent mutations.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

SKSpriteNode.init()

inherited init: cannot prove legal (class declares 7 custom initializers)

All SpriteKit types →