コード例 #1
0
        public static MySprite1 Create(string spriteFrameName)
        {
            CCSpriteFrame frame  = CCSpriteFrameCache.SharedSpriteFrameCache[spriteFrameName];
            MySprite1     sprite = new MySprite1(frame);

            return(sprite);
        }
コード例 #2
0
        public static MySprite1 Create(string spriteFrameName)
        {
            CCSpriteFrame frame = CCSpriteFrameCache.SharedSpriteFrameCache[spriteFrameName];
            MySprite1 sprite = new MySprite1(frame);

            return sprite;
        }
コード例 #3
0
ファイル: SpriteSubclass.cs プロジェクト: Karunp/cocos2d-xna
        public static MySprite1 Create(string pszSpriteFrameName)
        {
            CCSpriteFrame pFrame = CCSpriteFrameCache.SharedSpriteFrameCache.SpriteFrameByName(pszSpriteFrameName);
            MySprite1 pobSprite = new MySprite1();
            pobSprite.InitWithSpriteFrame(pFrame);

            return pobSprite;
        }
コード例 #4
0
        public static MySprite1 spriteWithSpriteFrameName(string pszSpriteFrameName)
        {
            CCSpriteFrame pFrame = CCSpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(pszSpriteFrameName);
            MySprite1 pobSprite = new MySprite1();
            pobSprite.initWithSpriteFrame(pFrame);

            return pobSprite;
        }
コード例 #5
0
        public static MySprite1 Create(string pszSpriteFrameName)
        {
            CCSpriteFrame pFrame    = CCSpriteFrameCache.SharedSpriteFrameCache.SpriteFrameByName(pszSpriteFrameName);
            MySprite1     pobSprite = new MySprite1();

            pobSprite.InitWithSpriteFrame(pFrame);

            return(pobSprite);
        }
コード例 #6
0
        public static MySprite1 spriteWithSpriteFrameName(string pszSpriteFrameName)
        {
            CCSpriteFrame pFrame    = CCSpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(pszSpriteFrameName);
            MySprite1     pobSprite = new MySprite1();

            pobSprite.initWithSpriteFrame(pFrame);

            return(pobSprite);
        }
コード例 #7
0
        public SpriteSubclass()
        {
            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFrames("animations/ghosts.plist");

            // MySprite1
            sprite = MySprite1.Create("father.gif");
            AddChild(sprite);

            // MySprite2
            sprite2 = new MySprite2("Images/grossini");
            AddChild(sprite2);
        }
コード例 #8
0
        public SpriteSubclass()
        {
            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFrames("animations/ghosts.plist");

            // MySprite1
            sprite = MySprite1.Create("father.gif");
            AddChild(sprite);

            // MySprite2
            sprite2 = new MySprite2("Images/grossini");
            AddChild(sprite2);
        }
コード例 #9
0
        public SpriteSubclass()
        {
            CCSize s = CCDirector.SharedDirector.WinSize;

            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFramesWithFile("animations/ghosts.plist");
            CCSpriteBatchNode aParent = new CCSpriteBatchNode("animations/ghosts");

            // MySprite1
            MySprite1 sprite = MySprite1.Create("father.gif");

            sprite.Position = (new CCPoint(s.Width / 4 * 1, s.Height / 2));
            aParent.AddChild(sprite);
            AddChild(aParent);

            // MySprite2
            MySprite2 sprite2 = MySprite2.Create("Images/grossini");

            AddChild(sprite2);
            sprite2.Position = (new CCPoint(s.Width / 4 * 3, s.Height / 2));
        }
コード例 #10
0
        public SpriteSubclass()
        {
            CCSize s = CCDirector.sharedDirector().getWinSize();

            CCSpriteFrameCache.sharedSpriteFrameCache().addSpriteFramesWithFile("animations/ghosts");
            CCSpriteBatchNode aParent = CCSpriteBatchNode.batchNodeWithFile("animations/images/ghosts");

            // MySprite1
            MySprite1 sprite = MySprite1.spriteWithSpriteFrameName("father.gif");

            sprite.position = (new CCPoint(s.width / 4 * 1, s.height / 2));
            aParent.addChild(sprite);
            addChild(aParent);

            // MySprite2
            MySprite2 sprite2 = MySprite2.spriteWithFile("Images/grossini");

            addChild(sprite2);
            sprite2.position = (new CCPoint(s.width / 4 * 3, s.height / 2));
        }