I'm trying to use a "while loop" while my SKSpritenode
is animating and I want to trigger the end of the SKAction
to trigger the end of the loop. This is my attempt
while (orgNode.hasActions) {
//render the background
}
what I want to do is create a bottom up sweep effect that changes the sprite nodes texture underneath the originNode's position, so that the user sees the sweeping motion of the node changing the background color.
You can override the update
or didEvaluateActions
function of the SKScene
if you want to update the node every frame. didEvaluateActions
function is called in each frame after all the SKActions
are evaluated. The update
function is called before all actions are evaluated.
override func didEvaluateActions() {
if node.hasActions()
{
println("Running Action")
}
}
The following image shows which all functions are called in each frame and in what order.
For more information : https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Introduction/Introduction.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.