Ejemplo n.º 1
0
        public IntroLayer()
        {
            CCSize windowSize = CCDirector.SharedDirector.WinSize;

            CCSprite tmp = new CCSprite("goblins");
            tmp.SetPosition(windowSize.Width / 2, windowSize.Height / 2);
            AddChild(tmp);

            String name = @"Content/goblins";
            skeletonNode = new CCSkeletonAnimation(name + ".json", name + ".atlas", 1.0f);

            if (name == "goblins") skeletonNode.setSkin("goblin");

            skeletonNode.NodeToWorldTransform();
            skeletonNode.setSlotsToSetupPose();
            skeletonNode.updateWorldTransform();

            skeletonNode.AddAnimation(0, "walk", true, 4);
            skeletonNode.SetAnimation(0, "walk", true);

            skeletonNode.Start += Start;
            skeletonNode.End += End;
            skeletonNode.Complete += Complete;
            skeletonNode.Event += Event;

            skeletonNode.findSlot("head");

            skeletonNode.SetPosition(windowSize.Width / 2, windowSize.Height / 2);
            AddChild(skeletonNode);
        }
Ejemplo n.º 2
0
        public IntroLayer()
        {
            CCSize windowSize = CCDirector.SharedDirector.WinSize;

            String name = @"Content\goblins";
            skeletonNode = new CCSkeletonAnimation(name + ".json", name + ".atlas", 1.0f);

            skeletonNode.setSkin("goblin");

            skeletonNode.NodeToWorldTransform();
            skeletonNode.setSlotsToSetupPose();
            skeletonNode.updateWorldTransform();

            skeletonNode.AddAnimation(0, "walk", true, 4);
            skeletonNode.SetAnimation(0, "walk", true);

            skeletonNode.Start += Start;
            skeletonNode.End += End;
            skeletonNode.Complete += Complete;
            skeletonNode.Event += Event;

            skeletonNode.findSlot("head");

            skeletonNode.RunAction(new CCRepeatForever(new CCSequence(
                    new CCFadeOut(1), new CCFadeIn(1)
                    )));

            skeletonNode.RunAction(new CCRepeatForever(new CCSequence(
                new CCMoveTo(5, new CCPoint(900, 10)), new CCMoveTo(5, new CCPoint(10, 10))
                )));

            skeletonNode.SetPosition(windowSize.Width / 2, windowSize.Height / 2);
            AddChild(skeletonNode);
        }