SKNode Class

Definition

The building block out of which scene-graphs are made. The root of the tree is an SKScene.

[Foundation.Register("SKNode", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public class SKNode : AppKit.NSResponder, Foundation.INSCopying, Foundation.INSSecureCoding, IDisposable, System.Collections.Generic.IEnumerable<SpriteKit.SKNode>
[Foundation.Register("SKNode", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 9, ObjCRuntime.PlatformArchitecture.Arch64, null)]
public class SKNode : AppKit.NSResponder, Foundation.INSCopying, Foundation.INSSecureCoding, IDisposable, System.Collections.Generic.IEnumerable<SpriteKit.SKNode>
type SKNode = class
    inherit NSResponder
    interface INSCoding
    interface INativeObject
    interface IDisposable
    interface INSCopying
    interface INSSecureCoding
    interface IEnumerable
    interface seq<SKNode>
Inheritance
Derived
Attributes
Implements

Remarks

ClassDescription
SKCropNode Uses a mask to crop its children.
SKEffectNode Applies a CIFilter to its children.
SKEmitterNode Produces and displays particles.
SKLabelNode Displays text.
T:SpriteKit.SKSceneNode Runs an animation loop, including display, actions, and physics.
SKShapeNode Displays a CGPath-based shape.
SKSpriteNode Displays a textured sprite.

Constructors

SKNode()

Default constructor, initializes a new instance of this class.

SKNode(IntPtr)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

SKNode(NSCoder)

A constructor that initializes the object from the data stored in the unarchiver object.

SKNode(NSObjectFlag)

Constructor to call on derived classes to skip initialization and merely allocate the object.

Properties

AccessibilityAssistiveTechnologyFocusedIdentifiers (Inherited from UIResponder)
AccessibilityCustomActions

Allows methods to be added to AccessibilityCustomActions as accessibility-supporting supplementary actions.

(Inherited from UIResponder)
AccessibilityDragSourceDescriptors (Inherited from UIResponder)
AccessibilityDropPointDescriptors (Inherited from UIResponder)
Alpha

Gets or sets the transparency for the node. 1.0 is opaque.

AttributeValues

Developers should not use this deprecated property. Attributes are only available for node classes supporting SKShader (see SKSpriteNode etc.).

CanBecomeFirstResponder

Determines whether this UIREsponder is willing to become the first responder.

(Inherited from UIResponder)
CanBecomeFocused
CanResignFirstResponder

Determines whether this UIResponder is willing to give up its first responder status.

(Inherited from UIResponder)
Children

Gets the list of this node's child nodes.

Class (Inherited from NSObject)
ClassHandle

The handle for this class.

Constraints

Gets or sets the list of constraints that are applied to this node.

DebugDescription

A developer-meaningful description of this object.

(Inherited from NSObject)
Description

Description of the object, the Objective-C version of ToString.

(Inherited from NSObject)
FocusBehavior
FocusItemContainer

Gets the container that manages focus information for child focus items.

Frame

Gets the rectangle, in the parent node's coordinate system, that contains only the current node.

Handle

Handle (pointer) to the unmanaged object representation.

(Inherited from NSObject)
HasActions

Gets a value that tells whether the node is currently running actions.

Hidden

Gets a value that tells whether the node and its descendants are rendered to the screen.

InputAccessoryView

Custom view that can be attached when the object becomes the first responder.

(Inherited from UIResponder)
InputAccessoryViewController

Gets the custom accessory UIInputViewController to display when this UIResponder becomes the first responder.

(Inherited from UIResponder)
InputAssistantItem

Gets the assistant that will be used to configure the shortcut bar.

(Inherited from UIResponder)
InputView

Custom view to display when the object becomes the first responder. Read-only.

(Inherited from UIResponder)
InputViewController

Gets the custom UIInputViewController to display when this UIResponder becomes the first responder.

(Inherited from UIResponder)
IsDirectBinding (Inherited from NSObject)
IsFirstResponder

Returns whether this UIResponder is the First Responder.

(Inherited from UIResponder)
IsProxy (Inherited from NSObject)
KeyCommands

The key commands that should trigger action on this UIResponder. Read-only.

(Inherited from UIResponder)
Name

Gets or sets the name that is used when searching for the node.

NextResponder

The next responder on the response chain

(Inherited from UIResponder)
Parent

Gets this node's parent.

ParentFocusEnvironment

Gets the parent focus environment.

PasteConfiguration

The UIPasteConfiguration supported by this object.

(Inherited from UIResponder)
Paused

Gets or sets a value that causes this node and its descendants to be skipped when actions are processed for the scene. true causes them to be skipped.

PhysicsBody

Gets or sets the physics body, if any, that controls the node's position and rotation.

Position

Gets or sets the node's position.

PreferredFocusedView
PreferredFocusEnvironments
ReachConstraints

Gets or sets the constraints that operate on the node for inverse kinematic reaching.

RetainCount

Returns the current Objective-C retain count for the object.

(Inherited from NSObject)
Scene

Gets the scene in which the node is processed.

Self (Inherited from NSObject)
Speed

Sets a value that controls the speed at which actions are run on the node. 1.0 corresponds to normal speed.

Superclass (Inherited from NSObject)
SuperHandle

Handle used to represent the methods in the base class for this NSObject.

(Inherited from NSObject)
TextInputContextIdentifier

An identifier indicating that this UIResponder should preserve its text input mode information. Read-only.

(Inherited from UIResponder)
TextInputMode

The text input mode for this UIResponder. Read-only.

(Inherited from UIResponder)
UndoManager

The nearest shared NSUndoManager in the responder chain. Read-only.

(Inherited from UIResponder)
UserActivity

Action that encapsulates a user activity that is supported by this responder.

(Inherited from UIResponder)
UserData

Gets or sets the dictionary of values that the application developer can use to store custom data on the node.

UserInteractionEnabled

Gets or sets a value that controls whether the node responds to touch.

XScale

Gets or sets the scale factor for the X direction.

YScale

Gets or sets the scale factor for the Y direction..

Zone (Inherited from NSObject)
ZPosition

Gets or set the node's position in the Z direction.

ZRotation

Gets or sets the node's rotation about the Z axis.

Methods

AccessibilityDecrement()

Tells the accessibility element to decrement the value of its content.

(Inherited from UIResponder)
AccessibilityElementDidBecomeFocused()

Indicates that an assistive technology has set its focus to this UIResponder.

(Inherited from UIResponder)
AccessibilityElementDidLoseFocus()

Indicates that an assistive technology has changed its focus from this UIResponder.

(Inherited from UIResponder)
AccessibilityElementIsFocused()

Indicates whether an assistive technology is focused on this UIResponder.

(Inherited from UIResponder)
AccessibilityIncrement()

Tells the accessibility element to increment the value of its content.

(Inherited from UIResponder)
AccessibilityPerformEscape()

Tells the accessibility system to dismiss a modal popover or hierarchically-displayed element.

(Inherited from UIResponder)
AccessibilityPerformMagicTap()

Toggles the application-defined "most important state" of the app.

(Inherited from UIResponder)
AccessibilityScroll(UIAccessibilityScrollDirection)

When overridden, allows the accessibility system to perform scrolling.

(Inherited from UIResponder)
Add(SKNode)

Adds node to the end of the list of child nodes.

AddChild(SKNode)

Adds node to the end of the list of child nodes.

AddNodes(SKNode[])

Adds nodes to the end of the list of child nodes.

AddObserver(NSObject, NSString, NSKeyValueObservingOptions, IntPtr)

Registers an object for being observed externally (using NSString keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method.

(Inherited from NSObject)
AddObserver(NSObject, String, NSKeyValueObservingOptions, IntPtr)

Registers an object for being observed externally (using string keyPath).   Observed changes are dispatched to the observer’s object ObserveValue(NSString, NSObject, NSDictionary, IntPtr) method.

(Inherited from NSObject)
AddObserver(NSString, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AddObserver(String, NSKeyValueObservingOptions, Action<NSObservedChange>)

Registers an object for being observed externally using an arbitrary method.

(Inherited from NSObject)
AwakeFromNib()

Called after the object has been loaded from the nib file. Overriders must call base.AwakeFromNib().

(Inherited from NSObject)
BecomeFirstResponder()

Request the object to become the first responder.

(Inherited from UIResponder)
BeginInvokeOnMainThread(Action) (Inherited from NSObject)
BeginInvokeOnMainThread(Selector, NSObject)

Invokes asynchrously the specified code on the main UI thread.

(Inherited from NSObject)
Bind(NSString, NSObject, String, NSDictionary) (Inherited from NSObject)
Bind(String, NSObject, String, NSDictionary)
(Inherited from NSObject)
BindingInfo(String)
(Inherited from NSObject)
BindingOptionDescriptions(String)
(Inherited from NSObject)
BindingValueClass(String)
(Inherited from NSObject)
CalculateAccumulatedFrame()

Calculates and returns the smallest rectangle that contains the node and all of its child nodes.

CanPaste(NSItemProvider[])

Gets whether this can accept a paste operation by the .

(Inherited from UIResponder)
CanPerform(Selector, NSObject)

Determines if this UIResponder can perform the specified action. Typically used to probe for editing commands.

(Inherited from UIResponder)
CommitEditing() (Inherited from NSObject)
CommitEditing(NSObject, Selector, IntPtr) (Inherited from NSObject)
ConformsToProtocol(IntPtr)

Invoked to determine if this object implements the specified protocol.

(Inherited from NSObject)
ContainsPoint(CGPoint)

Returns true if point is contained by the node, otherwise false.

ConvertPointFromNode(CGPoint, SKNode)
ConvertPointToNode(CGPoint, SKNode)
Copy()

Performs a copy of the underlying Objective-C object.

(Inherited from NSObject)
Copy(NSObject)

Indicates a "Copy" editing operation.

(Inherited from UIResponder)
Copy(NSZone)

Performs a copy of the underlying Objective-C object.

Create()

Creates a new node.

Create(String)
Create(String, NSSet<Class>, NSError)
Create(String, Type[], NSError)
Cut(NSObject)

Indicates a "Cut" editing operation.

(Inherited from UIResponder)
DangerousAutorelease() (Inherited from NSObject)
DangerousRelease() (Inherited from NSObject)
DangerousRetain() (Inherited from NSObject)
Delete(NSObject)

Indicates a "Delete" editing operation.

(Inherited from UIResponder)
DidChange(NSKeyValueChange, NSIndexSet, NSString)

Indicates a change occurred to the indexes for a to-many relationship.

(Inherited from NSObject)
DidChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
DidChangeValue(String)

Indicates that a change occurred on the specified key.

(Inherited from NSObject)
DidHintFocusMovement(UIFocusMovementHint)

Called when the user's finger moves on the device or pad, to alert the Node that a focus change may occur.

DidUpdateFocus(UIFocusUpdateContext, UIFocusAnimationCoordinator)
Dispose()

Releases the resources used by the NSObject object.

(Inherited from NSObject)
Dispose(Boolean)

Releases the resources used by the SKNode object.

Dispose(Boolean)

Releases the resources used by the NSObject object.

(Inherited from NSObject)
DoesNotRecognizeSelector(Selector)

Indicates that this object does not recognize the specified selector.

(Inherited from NSObject)
EncodeTo(NSCoder)

Encodes the state of the object on the provided encoder

EnumerateChildNodes(String, SKNodeChildEnumeratorHandler)

Passes each child node that matches name, along with a reference to a boolean value, to enumerationHandler. App devs can set the referenced boolean value to true to stop iteration.

Equals(NSObject) (Inherited from NSObject)
Equals(Object) (Inherited from NSObject)
ExposedBindings() (Inherited from NSObject)
FromFile<T>(String)

Creates a new SKNode by loading the assets from a file included in the application.

GetActionForKey(String)

Returns the action that is identified by key, or null if no action exists for the key.

GetBindingInfo(NSString) (Inherited from NSObject)
GetBindingOptionDescriptions(NSString) (Inherited from NSObject)
GetBindingValueClass(NSString) (Inherited from NSObject)
GetChildNode(String)

Searches for and returns the first node that is matched by name.

GetDictionaryOfValuesFromKeys(NSString[])

Retrieves the values of the specified keys.

(Inherited from NSObject)
GetEnumerator()

Returns an enumerator that iterates over the child nodes that belong to the current node.

GetHashCode()

Generates a hash code for the current instance.

(Inherited from NSObject)
GetMethodForSelector(Selector) (Inherited from NSObject)
GetNativeField(String)
(Inherited from NSObject)
GetNativeHash() (Inherited from NSObject)
GetNodeAtPoint(CGPoint)

Returns either the most deeply nested descendant that contains point, where point is specified in the current node's coordinate system.

GetNodesAtPoint(CGPoint)

Returns an array that contains all the child nodes that contain point, where point is specified in the current node's coordinate system.

GetObjectsMatching(String)

Returns an array that contains all the nodes that are matched by nameExpression.

GetObstaclesFromNodeBounds(SKNode[])
GetObstaclesFromNodePhysicsBodies(SKNode[])
GetObstaclesFromSpriteTextures(SKNode[], Single)
GetTargetForAction(Selector, NSObject)

Returns the object that responds to an action.

(Inherited from UIResponder)
GetValue(String)
Init() (Inherited from NSObject)
InitializeHandle(IntPtr) (Inherited from NSObject)
InitializeHandle(IntPtr, String) (Inherited from NSObject)
InParentHierarchy(SKNode)

Returns true if the current node is in the hierarchy below node.

InsertChild(SKNode, nint)

Inserts node at the position that is specified by index into the list of this node's children.

IntersectsNode(SKNode)

Returns true if the current node's frame intersects with the frame of the specified node, not counting the children of either node.

Invoke(Action, Double) (Inherited from NSObject)
Invoke(Action, TimeSpan) (Inherited from NSObject)
InvokeOnMainThread(Action) (Inherited from NSObject)
InvokeOnMainThread(Selector, NSObject)

Invokes synchrously the specified code on the main UI thread.

(Inherited from NSObject)
IsEqual(NSObject) (Inherited from NSObject)
IsEqual(SKNode)
IsKindOfClass(Class) (Inherited from NSObject)
IsMemberOfClass(Class) (Inherited from NSObject)
MakeTextWritingDirectionLeftToRight(NSObject)

Sets the direction in which text is written to be left-to-right.

(Inherited from UIResponder)
MakeTextWritingDirectionRightToLeft(NSObject)

Sets the direction in which text is written to be right-to-left.

(Inherited from UIResponder)
MarkDirty()

Promotes a regular peer object (IsDirectBinding is true) into a toggleref object.

(Inherited from NSObject)
MotionBegan(UIEventSubtype, UIEvent)

Method invoked when a motion (a shake) has started.

(Inherited from UIResponder)
MotionCancelled(UIEventSubtype, UIEvent)

Method invoked if the operating system cancels a motion (shake) event.

(Inherited from UIResponder)
MotionEnded(UIEventSubtype, UIEvent)

Method invoked when a motion (shake) has finished.

(Inherited from UIResponder)
MoveToParent(SKNode)

Changes the Parent of this SKNode to parent.

MutableCopy()

Creates a mutable copy of the specified NSObject.

(Inherited from NSObject)
ObjectDidEndEditing(NSObject) (Inherited from NSObject)
ObserveValue(NSString, NSObject, NSDictionary, IntPtr)

Indicates that the value at the specified keyPath relative to this object has changed.

(Inherited from NSObject)
ObstaclesFromNodeBounds(SKNode[])

Creates a new GKPolygonObstacle for each SKNode in nodes.

ObstaclesFromNodePhysicsBodies(SKNode[])

Creates a new GKPolygonObstacle for each PhysicsBody in the SKNode object in nodes

ObstaclesFromSpriteTextures(SKNode[], Single)

Creates a new GKPolygonObstacle by converting the Texture of each SKNode object in nodes.

Paste(NSItemProvider[])

Called to perform a paste operation from .

(Inherited from UIResponder)
Paste(NSObject)

Indicates a "Paste" editing operation.

(Inherited from UIResponder)
PerformSelector(Selector) (Inherited from NSObject)
PerformSelector(Selector, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSObject, Double)

Invokes the selector on the current instance and if the obj is not null, it passes this as its single parameter.

(Inherited from NSObject)
PerformSelector(Selector, NSObject, Double, NSString[]) (Inherited from NSObject)
PerformSelector(Selector, NSObject, NSObject) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean) (Inherited from NSObject)
PerformSelector(Selector, NSThread, NSObject, Boolean, NSString[]) (Inherited from NSObject)
PrepareForInterfaceBuilder() (Inherited from NSObject)
PressesBegan(NSSet<UIPress>, UIPressesEvent)

Indicates that a physical button has been pressed on a remote or game controller.

(Inherited from UIResponder)
PressesCancelled(NSSet<UIPress>, UIPressesEvent)

Indicates a physical button-press event has been cancelled due to a system event.

(Inherited from UIResponder)
PressesChanged(NSSet<UIPress>, UIPressesEvent)

Indicates that the Force value of the evt has changed.

(Inherited from UIResponder)
PressesEnded(NSSet<UIPress>, UIPressesEvent)

Indicates the ending of a press of a physical button on a remote or game controller.

(Inherited from UIResponder)
ReloadInputViews()

Updates custom input and accessory views when this object is the first responder.

(Inherited from UIResponder)
RemoteControlReceived(UIEvent)

Indicates that a remote-control event was received.

(Inherited from UIResponder)
RemoveActionForKey(String)

Removes the action that is identified by key, if present.

RemoveAllActions()

Removes all the actions from the node.

RemoveAllChildren()

Removes all of the node's child nodes.

RemoveChildren(SKNode[])

Removes the specified list of nodes from the current node's list of child nodes.

RemoveFromParent()

Removes this node from its parent.

RemoveObserver(NSObject, NSString)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath.

(Inherited from NSObject)
RemoveObserver(NSObject, NSString, IntPtr)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context.

(Inherited from NSObject)
RemoveObserver(NSObject, String)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath.

(Inherited from NSObject)
RemoveObserver(NSObject, String, IntPtr)

Stops the specified observer from receiving further notifications of changed values for the specified keyPath and context.

(Inherited from NSObject)
ResignFirstResponder()

Called when this UIResponder has been asked to resign its first responder status.

(Inherited from UIResponder)
RespondsToSelector(Selector)

Whether this object recognizes the specified selector.

(Inherited from NSObject)
RestoreUserActivityState(NSUserActivity)

Restores the state that is necessary for continuance of the specified user activity.

(Inherited from UIResponder)
RunAction(SKAction)

Adds an action to the node that will first be processed in the next animation loop.

RunAction(SKAction, Action)

Adds an action to the node that will be processed in the next animation loop, and calls completionHandler after the action completes.

RunAction(SKAction, String)

Adds an action to the node, accessible with the specified key, that will be processed in the next animation loop.

RunActionAsync(SKAction)

Adds an action to the node that will be processed in the next animation loop, and calls completionHandler after the action completes.

Select(NSObject)

Indicates a "Select" editing operation.|b

(Inherited from UIResponder)
SelectAll(NSObject)

Indicates a "Select All" editing operation.

(Inherited from UIResponder)
SetNativeField(String, NSObject)
(Inherited from NSObject)
SetNeedsFocusUpdate()
SetNilValueForKey(NSString)

Sets the value of the specified key to null.

(Inherited from NSObject)
SetScale(nfloat)

Sets the X- and Y-scales to scale.

SetValue(SKAttributeValue, String)
SetValueForKey(NSObject, NSString)

Sets the value of the property specified by the key to the specified value.

(Inherited from NSObject)
SetValueForKeyPath(IntPtr, NSString)

A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

(Inherited from NSObject)
SetValueForKeyPath(NSObject, NSString)

Sets the value of a property that can be reached using a keypath.

(Inherited from NSObject)
SetValueForUndefinedKey(NSObject, NSString)

Indicates an attempt to write a value to an undefined key. If not overridden, raises an NSUndefinedKeyException.

(Inherited from NSObject)
SetValuesForKeysWithDictionary(NSDictionary)

Sets the values of this NSObject to those in the specified dictionary.

(Inherited from NSObject)
ShouldUpdateFocus(UIFocusUpdateContext)
ToggleBoldface(NSObject)

Toggles the use of a bold font.

(Inherited from UIResponder)
ToggleItalics(NSObject)

Toggles the use of an italic font.

(Inherited from UIResponder)
ToggleUnderline(NSObject)

Toggles the use of underlining.

(Inherited from UIResponder)
ToString()

Returns a string representation of the value of the current instance.

(Inherited from NSObject)
TouchesBegan(NSSet, UIEvent)

Sent when one or more fingers touches the screen.

(Inherited from UIResponder)
TouchesCancelled(NSSet, UIEvent)

Sent when the touch processing has been cancelled.

(Inherited from UIResponder)
TouchesEnded(NSSet, UIEvent)

Sent when one or more fingers are lifted from the screen.

(Inherited from UIResponder)
TouchesEstimatedPropertiesUpdated(NSSet)

Called when the estimated properties of touches have been updated.

(Inherited from UIResponder)
TouchesMoved(NSSet, UIEvent)

Sent when one or more fingers move on the screen.

(Inherited from UIResponder)
Unbind(NSString) (Inherited from NSObject)
Unbind(String)
(Inherited from NSObject)
UpdateFocusIfNeeded()
UpdateUserActivityState(NSUserActivity)

Updates a given user activity state.

(Inherited from UIResponder)
ValueForKey(NSString)

Returns the value of the property associated with the specified key.

(Inherited from NSObject)
ValueForKeyPath(NSString)

Returns the value of a property that can be reached using a keypath.

(Inherited from NSObject)
ValueForUndefinedKey(NSString)

Indicates an attempt to read a value of an undefined key. If not overridden, raises an NSUndefinedKeyException.

(Inherited from NSObject)
WillChange(NSKeyValueChange, NSIndexSet, NSString)

Indicates that the values of the specified indices in the specified key are about to change.

(Inherited from NSObject)
WillChange(NSString, NSKeyValueSetMutationKind, NSSet) (Inherited from NSObject)
WillChangeValue(String)

Indicates that the value of the specified key is about to change.

(Inherited from NSObject)

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Internal.

Extension Methods

ObjectDidBeginEditing(NSObject, INSEditor)
ObjectDidEndEditing(NSObject, INSEditor)
GetValidModes(NSObject, NSFontPanel)
ValidateToolbarItem(NSObject, NSToolbarItem)
GetDebugDescription(INSObjectProtocol)
GetEntity(SKNode)
SetEntity(SKNode, GKEntity)
AcceptsPreviewPanelControl(NSObject, QLPreviewPanel)
BeginPreviewPanelControl(NSObject, QLPreviewPanel)
EndPreviewPanelControl(NSObject, QLPreviewPanel)
GetAccessibilityCustomRotors(NSObject)

Gets the array of UIAccessibilityCustomRotor objects appropriate for this object.

SetAccessibilityCustomRotors(NSObject, UIAccessibilityCustomRotor[])

Sets the array of UIAccessibilityCustomRotor objects appropriate for this object.

CanPaste(IUIPasteConfigurationSupporting, NSItemProvider[])

Returns true if the responder can paste from the specified item providers.

Paste(IUIPasteConfigurationSupporting, NSItemProvider[])

Performs the paste.

DecreaseSize(UIResponder, NSObject)

A hardware keyboard request (Command-minus) to decrease the size of the UIResponder.

IncreaseSize(UIResponder, NSObject)

A hardware keyboard request (Command-plus) to increase the size of the UIResponder.

Applies to

See also