Description: CCNode RunAction is a method provided by the Cocos2D package/library for C# programming language. This method enables a CCNode object to perform a specified action in a scheduled manner.
Example 1: To rotate a CCNode object in a clockwise direction by 90 degrees.
CCNode node = new CCNode(); var rotationAction = new CCRotateBy(1.0f, 90.0f); node.RunAction(rotationAction);
Explanation: In this example, a new CCNode object is created and assigned to a variable named "node". Then, a CCRotateBy action object is created with a duration of 1 second and rotation angle of 90 degrees. Finally, the "RunAction" method is called on the "node" variable with the "rotationAction" object as its argument. This will start the rotation of the "node" object.
Example 2: To move a CCNode object from its current position to a new position in 2 seconds.
CCNode node = new CCNode(); var positionAction = new CCMoveTo(2.0f, new CCPoint(100.0f, 100.0f)); node.RunAction(positionAction);
Explanation: In this example, a new CCNode object is created and assigned to a variable named "node". Then, a CCMoveTo action object is created with a duration of 2 seconds and a new position of (100,100). Finally, the "RunAction" method is called on the "node" variable with the "positionAction" object as its argument. This will start the movement of the "node" object from its current position to (100,100) in 2 seconds.
Package/Library: Cocos2D package/library.
C# (CSharp) cocos2d CCNode.RunAction - 7 examples found. These are the top rated real world C# (CSharp) examples of cocos2d.CCNode.RunAction extracted from open source projects. You can rate examples to help us improve the quality of examples.