macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

+followPath:duration:

INDEX>Sprite Kit>SKAction

パスで指定した軌跡で移動するアクションを作成します
+ (SKAction *)followPath:(CGPathRef)path duration:(NSTimeInterval)sec

解説

パスで指定した軌跡で移動するアクションを作成します。

返り値


引数

クラス

SKAction

使用可能

iOS 7.0以降

定義

SKAction.h

参照

例文

//アクションの作成
CGMutablePathRef aPath = CGPathCreateMutable();
CGPathMoveToPoint(aPath, NULL,0.0, 0.0);
CGPathAddArcToPoint(aPath, NULL,
                            200.0,
                            200.0,
                            450.0,
                            0.0,
                            300.0);
SKAction *action = [SKAction followPath:aPath duration:1];
        
//アクション実行
[sprite runAction:action];
        

編集時のバージョン

OS X 10.9
iOS 7.0