public override void TouchesBegan(Foundation.NSSet touches, UIEvent evt) { foreach (UITouch touch in touches) { var location = touch.LocationInNode(this); var sprite = new SKSpriteNode("Spaceship") { Position = location, }; var action = SKAction.RotateByAngle((float)Math.PI, 1); sprite.RunAction(SKAction.RepeatActionForever(action)); AddChild(sprite); } }
public override void TouchesBegan(NSSet touches, UIEvent evt) { // Called when a touch begins foreach (UITouch touch in touches) { var location = touch.LocationInNode(this); var sprite = new SKSpriteNode("Spaceship") { Position = location, XScale = 0.5f, YScale = 0.5f }; var action = SKAction.RotateByAngle(NMath.PI, 1.0); sprite.RunAction(SKAction.RepeatActionForever(action)); AddChild(sprite); } }
public static SKAction ResizeTo(CGSize size, double duration) { return(SKAction.ResizeTo(size.Width, size.Height, duration)); }