Home Reference Source Repository
import SCNActionable from 'jscenekit/js/SceneKit/SCNActionable.js'
public interface | source

SCNActionable

Direct Implemented:

Indirect Implemented:

Methods for running actions on nodes.

See:

Constructor Summary

Public Constructor
public

constructor

Member Summary

Public Members
public get

Use this property to list actions you scheduled using the runAction(:forKey:) or runAction(:forKey:completionHandler:) method.

public get

This value is true if the node has any executing actions; otherwise the value is false.

Method Summary

Public Methods
public

Use this method to retrieve actions you scheduled using the runAction(:forKey:) or runAction(:forKey:completionHandler:) method.

public

If the node is currently running an action that matches the key, SceneKit removes that action from the node, skipping any remaining animation it would perform but keeping any changes already made to the node.Use this method to cancel actions you scheduled using the runAction(:forKey:) or runAction(:forKey:completionHandler:) method.

public

When SceneKit removes an action from a node, it skips any remaining animation the action would perform.

public

runAction(action: SCNAction): void

SceneKit begins running a newly added action when it prepares to render the next frame.

public

runActionCompletionHandler(action: SCNAction, block: function(): void): void

The new action is processed the next time SceneKit prepares to render a frame.SceneKit calls your block after the action’s duration is complete.

public

runActionForKey(action: SCNAction, key: string): void

This method is identical to runAction(_:), but the action is stored and identified so that you can retrieve or cancel it later.

public

runActionForKeyCompletionHandler(action: SCNAction, key: string, block: function(): void): void

This method is identical to runAction(_:completionHandler:), but the action is stored and identified so that you can retrieve or cancel it later.

Public Constructors

public constructor() source

constructor

Public Members

public get actionKeys: string[] source

Use this property to list actions you scheduled using the runAction(:forKey:) or runAction(:forKey:completionHandler:) method.

See:

public get hasActions: boolean source

This value is true if the node has any executing actions; otherwise the value is false.

See:

Public Methods

public actionForKey(key: string): SCNAction source

Use this method to retrieve actions you scheduled using the runAction(:forKey:) or runAction(:forKey:completionHandler:) method.

Params:

NameTypeAttributeDescription
key string

A string that uniquely identifies a action.

Return:

SCNAction (nullable: true)

See:

public removeActionForKey(key: string): void source

If the node is currently running an action that matches the key, SceneKit removes that action from the node, skipping any remaining animation it would perform but keeping any changes already made to the node.Use this method to cancel actions you scheduled using the runAction(:forKey:) or runAction(:forKey:completionHandler:) method.

Params:

NameTypeAttributeDescription
key string

A string that uniquely identifies a action.

Return:

void

See:

public removeAllActions(): void source

When SceneKit removes an action from a node, it skips any remaining animation the action would perform. However, any changes the action has already made to the node’s state remain in effect.

Return:

void

See:

public runAction(action: SCNAction): void source

SceneKit begins running a newly added action when it prepares to render the next frame.

Params:

NameTypeAttributeDescription
action SCNAction

The action to be performed.

Return:

void

See:

public runActionCompletionHandler(action: SCNAction, block: function(): void): void source

The new action is processed the next time SceneKit prepares to render a frame.SceneKit calls your block after the action’s duration is complete. For example, in a game you could use this method to show a Game Over message after performing a fade-out action on a node that displays a player character.

Params:

NameTypeAttributeDescription
action SCNAction

The action to be performed.

block function(): void
  • optional
  • default: null
  • nullable: true

A completion block that SceneKit calls when the action completes.

Return:

void

See:

public runActionForKey(action: SCNAction, key: string): void source

This method is identical to runAction(_:), but the action is stored and identified so that you can retrieve or cancel it later. If an action using the same key is already running, SceneKit removes it before adding the new action.

Params:

NameTypeAttributeDescription
action SCNAction

The action to be performed.

key string
  • nullable: true

A unique key used to identify the action.

Return:

void

See:

public runActionForKeyCompletionHandler(action: SCNAction, key: string, block: function(): void): void source

This method is identical to runAction(_:completionHandler:), but the action is stored and identified so that you can retrieve or cancel it later. If an action using the same key is already running, SceneKit removes it before adding the new action.SceneKit calls your block after the action’s duration is complete. For example, you can use this method with a wait action to execute some code after a timed delay. If during the delay period you need to prevent the code from running, use the removeAction(forKey:) method to cancel it.

Params:

NameTypeAttributeDescription
action SCNAction

The action to be performed.

key string
  • nullable: true

A unique key used to identify the action.

block function(): void
  • optional
  • default: null
  • nullable: true

A completion block called when the action completes.

Return:

void

See: