protected override void CreateSceneContents()
 {
     base.CreateSceneContents();
     AddAnchorGrid();
     AddAnimatedAnchor();
     Scene.AddDescription("The dots mark the actual position of each sprite node",
                          new CGPoint(Scene.Frame.GetMidX(), 100));
 }
        void AddBlendFactorLabels()
        {
            var label = Scene.AddDescription("Color blend factor:", new CGPoint(80, Scene.Frame.GetMaxY() - 70));

            label.HorizontalAlignmentMode = SKLabelHorizontalAlignmentMode.Left;

            for (int i = 0; i <= 10; i++)
            {
                string text        = (i / 10.0f).ToString("0.00");
                var    pos         = new CGPoint(85 + i * template.Size.Width + 10, Scene.Frame.GetMaxY() - 90);
                var    numberLabel = Scene.AddDescription(text, pos);
                numberLabel.HorizontalAlignmentMode = SKLabelHorizontalAlignmentMode.Left;
            }
        }
        protected override void CreateSceneContents()
        {
            base.CreateSceneContents();

            // no point in recomputing constant values each time
            var half_range = range / 2.0f;

            basex = (float)Scene.Frame.GetMidX() - half_range;
            basey = (float)Scene.Frame.GetMidY() - half_range;

            Scene.AddDescription("These textured sprite nodes are combined using an additive blend",
                                 new CGPoint(Scene.Frame.GetMidX(), 100));

            Scene.RunAction(SKAction.RepeatActionForever(SKAction.Sequence(
                                                             SKAction.Run(AddLight),
                                                             SKAction.WaitForDuration(0.5f, 0.1f)
                                                             )));
        }
        protected override void CreateSceneContents()
        {
            base.CreateSceneContents();

            SKTexture[] walkFrames = LoadFrames("Art/warrior_walk_", 28);

            SKSpriteNode sprite = new SKSpriteNode(walkFrames [0])
            {
                Position = new CGPoint(Scene.Frame.GetMidX(), Scene.Frame.GetMidY())
            };

            Scene.AddChild(sprite);

            //Cycle through the frame
            var animation = SKAction.AnimateWithTextures(walkFrames, 1.0f / 28, true, false);

            sprite.RunAction(SKAction.RepeatActionForever(animation));

            Scene.AddDescription("This sprite is animating through a series of texture images.",
                                 new CGPoint(Scene.Frame.GetMidX(), 100));
        }
        void AddAnimatedSprite()
        {
            SKSpriteNode animatedSprite = (SKSpriteNode)(template as NSObject).Copy();

            animatedSprite.Position = new CGPoint(925, 384);

            Scene.AddChild(animatedSprite);
            Scene.AddDescription("Animated Color Blending",
                                 new CGPoint(animatedSprite.Position.X, animatedSprite.Position.Y - 90));

            animatedSprite.RunAction(SKAction.RepeatActionForever(SKAction.Sequence(
                                                                      SKAction.WaitForDuration(1.0),
                                                                      SKAction.ColorizeWithColor(UIColor.Red, 1.0f, 1.0f),
                                                                      SKAction.WaitForDuration(1.0),
                                                                      SKAction.ColorizeWithColor(UIColor.Green, 1.0f, 1.0f),
                                                                      SKAction.WaitForDuration(1.0),
                                                                      SKAction.ColorizeWithColor(UIColor.Blue, 1.0f, 1.0f),
                                                                      SKAction.WaitForDuration(1.0),
                                                                      SKAction.ColorizeWithColor(UIColor.Yellow, 1.0f, 1.0f),
                                                                      SKAction.WaitForDuration(1.0),
                                                                      SKAction.ColorizeWithColorBlendFactor(0.0f, 1.0f)
                                                                      )));
        }