私はint SpriteKitを取得しています。また、SKNode オブジェクトにモーション効果を作成する方法を知りたいです。
UIView の場合、次のメソッドを使用します。
+(void)registerEffectForView:(UIView *)aView
depth:(CGFloat)depth
{
UIInterpolatingMotionEffect *effectX;
UIInterpolatingMotionEffect *effectY;
effectX = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.x"
type:UIInterpolatingMotionEffectTypeTiltAlongHorizontalAxis];
effectY = [[UIInterpolatingMotionEffect alloc] initWithKeyPath:@"center.y"
type:UIInterpolatingMotionEffectTypeTiltAlongVerticalAxis];
effectX.maximumRelativeValue = @(depth);
effectX.minimumRelativeValue = @(-depth);
effectY.maximumRelativeValue = @(depth);
effectY.minimumRelativeValue = @(-depth);
[aView addMotionEffect:effectX];
[aView addMotionEffect:effectY];
}
SKNode に似たものは見つかりませんでした。だから私の質問はそれが可能ですか?そうでない場合は、どうすれば実装できますか。