Exemple #1
0
        /** Adds a frame with a texture and a rect. Internally it will create a CCSpriteFrame and it will add it.
         * Added to facilitate the migration from v0.8 to v0.9.
         */
        public void addFrameWithTexture(Texture pobTexture, CCRect rect)
        {
            CCSpriteFrame pFrame = CCSpriteFrame.frameWithTexture(pobTexture, rect);

            //// m_pobFrames.addObject(pFrame);
            m_pobFrames.Add(pFrame);
            throw new NotFiniteNumberException();
        }
Exemple #2
0
        public void addFrameWithTexture(CCTexture2D pobTexture, CCRect rect)
        {
            CCSpriteFrame cCSpriteFrame = CCSpriteFrame.frameWithTexture(pobTexture, rect);

            this.m_pobFrames.Add(cCSpriteFrame);
#if WINDOWS_UWP
            throw new Exception();
#else
            throw new NotFiniteNumberException();
#endif
        }
Exemple #3
0
        public void addFrameWithFileName(string pszFileName)
        {
            CCTexture2D cCTexture2D = CCTextureCache.sharedTextureCache().addImage(pszFileName);
            CCRect      cCRect      = new CCRect(0f, 0f, 0f, 0f)
            {
                size = cCTexture2D.getContentSize()
            };
            CCSpriteFrame cCSpriteFrame = CCSpriteFrame.frameWithTexture(cCTexture2D, cCRect);

            this.m_pobFrames.Add(cCSpriteFrame);
        }
Exemple #4
0
        /** Adds a frame with an image filename. Internally it will create a CCSpriteFrame and it will add it.
         * Added to facilitate the migration from v0.8 to v0.9.
         */
        public void addFrameWithFileName(string pszFileName)
        {
            Texture pTexture = CCTextureCache.sharedTextureCache().addImage(pszFileName);
            //CCRect rect = CCRectZero;
            CCRect rect = new CCRect(0, 0, 0, 0);

            rect.Size = pTexture.ContentSize;
            CCSpriteFrame pFrame = CCSpriteFrame.frameWithTexture(pTexture, rect);

            //// m_pobFrames.addObject(pFrame);
            m_pobFrames.Add(pFrame);
        }