+moveBy:duration:
移動するアクションを作成
+ (SKAction *)moveBy:(CGVector)delta
duration:(NSTimeInterval)sec
解説
移動するアクションを作成します。
返り値
(SKAction *)
新しい移動アクション
引数
(CGVector)delta
移動量
(NSTimeInterval)sec
アニメーションの継続時間
フレームワーク
Sprite Kit
クラス
SKAction
使用可能
iOS 7.0以降
参照
SKAction.h
例文
//アクションの作成 CGVector aVector = CGVectorMake(100.0f, 20.0f); SKAction *action = [SKAction moveBy:aVector duration:1 ]; //アクション実行 [sprite runAction:[SKAction repeatActionForever:action]];