示例#1
0
        public bool initWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            bool flag = true;

            this.m_bActive           = false;
            this.m_nReuseGrid        = 0;
            this.m_sGridSize         = gridSize;
            this.m_pTexture          = pTexture;
            this.m_bIsTextureFlipped = bFlipped;
            CCSize contentSizeInPixels = this.m_pTexture.ContentSizeInPixels;

            this.m_obStep = new CCPoint()
            {
                x = contentSizeInPixels.width / (float)this.m_sGridSize.x,
                y = contentSizeInPixels.height / (float)this.m_sGridSize.y
            };
            this.m_pGrabber = new CCGrabber();
            if (this.m_pGrabber == null)
            {
                flag = false;
            }
            else
            {
                this.m_pGrabber.grab(ref this.m_pTexture);
            }
            this.calculateVertexPoints();
            return(flag);
        }
示例#2
0
        public bool initWithSize(ccGridSize gridSize, Texture pTexture, bool bFlipped)
        {
            bool bRet = true;

            m_bActive    = false;
            m_nReuseGrid = 0;
            m_sGridSize  = gridSize;

            m_pTexture = pTexture;

            m_bIsTextureFlipped = bFlipped;

            CCSize texSize = m_pTexture.ContentSize;

            m_obStep   = new CCPoint();
            m_obStep.X = texSize.Width / (float)m_sGridSize.x;
            m_obStep.Y = texSize.Height / (float)m_sGridSize.y;

            m_pGrabber = new CCGrabber();
            if (m_pGrabber != null)
            {
                m_pGrabber.grab(ref m_pTexture);
            }
            else
            {
                bRet = false;
            }

            calculateVertexPoints();

            return(bRet);
        }
        public bool initWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            bool bRet = true;

            m_bActive = false;
            m_nReuseGrid = 0;
            m_sGridSize = gridSize;

            m_pTexture = pTexture;

            m_bIsTextureFlipped = bFlipped;

            CCSize texSize = m_pTexture.ContentSizeInPixels;
            m_obStep = new CCPoint();
            m_obStep.x = texSize.width / (float)m_sGridSize.x;
            m_obStep.y = texSize.height / (float)m_sGridSize.y;

            m_pGrabber = new CCGrabber();
            if (m_pGrabber != null)
            {
                m_pGrabber.grab(ref m_pTexture);
            }
            else
            {
                bRet = false;
            }

            calculateVertexPoints();

            return bRet;
        }
示例#4
0
        public bool InitWithSize(CCGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            bool bRet = true;

            m_bActive = false;
            m_nReuseGrid = 0;
            m_sGridSize = gridSize;

            m_pTexture = pTexture;

            m_bIsTextureFlipped = bFlipped;

            CCSize texSize = m_pTexture.ContentSize;
            m_obStep.X = texSize.Width / m_sGridSize.X;
            m_obStep.Y = texSize.Height / m_sGridSize.Y;

            m_pGrabber = new CCGrabber();
            if (m_pGrabber != null)
            {
                m_pGrabber.Grab(m_pTexture);
            }
            else
            {
                bRet = false;
            }

            //m_pShaderProgram = CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTexture);
            CalculateVertexPoints();

            return bRet;
        }