当前位置: 首页>>代码示例>>C#>>正文


C# cocos2d.CCTexture2D类代码示例

本文整理汇总了C#中cocos2d.CCTexture2D的典型用法代码示例。如果您正苦于以下问题:C# CCTexture2D类的具体用法?C# CCTexture2D怎么用?C# CCTexture2D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CCTexture2D类属于cocos2d命名空间,在下文中一共展示了CCTexture2D类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: grab

        public void grab(ref CCTexture2D pTexture)
        {
            // If the gles version is lower than GLES_VER_1_0, 
            // all the functions in CCGrabber return directly.
            if (m_eGlesVersion <= CCGlesVersion.GLES_VER_1_0)
            {
                return;
            }

            //glGetIntegerv(CC_GL_FRAMEBUFFER_BINDING, &m_oldFBO);

            // bind
            //ccglBindFramebuffer(CC_GL_FRAMEBUFFER, m_fbo);

            m_RenderTarget2D = new RenderTarget2D(CCApplication.sharedApplication().GraphicsDevice,
                (int)pTexture.ContentSizeInPixels.width,
                (int)pTexture.ContentSizeInPixels.height);

            pTexture.Texture = m_RenderTarget2D;

            // associate texture with FBO
            //ccglFramebufferTexture2D(CC_GL_FRAMEBUFFER, CC_GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
            //pTexture->getName(), 0);

            // check if it worked (probably worth doing :) )
            //GLuint status = ccglCheckFramebufferStatus(CC_GL_FRAMEBUFFER);
            //if (status != CC_GL_FRAMEBUFFER_COMPLETE)
            //{
            //    CCLOG("Frame Grabber: could not attach texture to frmaebuffer");
            //}

            //ccglBindFramebuffer(CC_GL_FRAMEBUFFER, m_oldFBO);
        }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:33,代码来源:CCGrabber.cs

示例2: CCSprite

 public CCSprite(CCTexture2D texture)
 {
     if (!InitWithTexture(texture))
     {
         CCLog.Log("CCSprite (CCTexture2D texture): Problems initializing class");
     }
 }
开发者ID:HarkDev,项目名称:cocos2d-xna,代码行数:7,代码来源:CCSprite.cs

示例3: Selection

        public Selection(Word p_StudyInfo, bool p_IsAnswer,Int32 p_Width,Int32 p_Height)
        {
            base.init();
            this.StudyInfo = p_StudyInfo;

            CCTexture2D texture = new CCTexture2D();
            texture.initWithTexture(PictureManager.GetTexture2D(p_StudyInfo));

            if (p_Width < texture.ContentSizeInPixels.width)
            {
                this.scaleX = p_Width / texture.ContentSizeInPixels.width;
            }
            if (p_Height < texture.ContentSizeInPixels.height)
            {
                this.scaleY = p_Height / texture.ContentSizeInPixels.height;
            }
            this.contentSize.width = p_Width;
            this.contentSize.height = p_Height;

            CCRect rect = new CCRect();
            rect.size = new CCSize(texture.ContentSizeInPixels.width, texture.ContentSizeInPixels.height);
            this.initWithTexture(texture, rect);

            this.IsAnswer = p_IsAnswer;
            LoadResultPeople();
        }
开发者ID:tianjing,项目名称:SayWordByPicture,代码行数:26,代码来源:Selection.cs

示例4: GetCCTexture2D

 public static CCTexture2D GetCCTexture2D(Stream p_PicStrean)
 {
     Texture2D text2D = Texture2D.FromStream(CCApplication.sharedApplication().GraphicsDevice, p_PicStrean);
     CCTexture2D cctext2D = new CCTexture2D();
     cctext2D.initWithTexture(text2D);
     return cctext2D;
 }
开发者ID:tianjing,项目名称:SayWordByPicture,代码行数:7,代码来源:PictureManager.cs

示例5: GetCCTexture2D

        public static CCTexture2D GetCCTexture2D(Word p_Word,Int32 p_Width,Int32 p_Height,bool p_Zoom)
        {
            CCTexture2D result = new CCTexture2D();
            result.initWithTexture(GetTexture2D(p_Word),new CCSize(p_Width,p_Height));

            return result;
        }
开发者ID:tianjing,项目名称:SayWordByPicture,代码行数:7,代码来源:PictureManager.cs

示例6: ballWithTexture

        public static Ball ballWithTexture(CCTexture2D aTexture)
        {
            Ball pBall = new Ball();
            pBall.InitWithTexture(aTexture);
            //pBall->autorelease();

            return pBall;
        }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:8,代码来源:Ball.cs

示例7: paddleWithTexture

        public static Paddle paddleWithTexture(CCTexture2D aTexture)
        {
            Paddle pPaddle = new Paddle();
            pPaddle.initWithTexture(aTexture);
            //pPaddle->autorelease();

            return pPaddle;
        }
开发者ID:Openxlive,项目名称:cocos2d-x-for-xna,代码行数:8,代码来源:Paddle.cs

示例8: initWithTexture

 public new bool initWithTexture(CCTexture2D aTexture)
 {
     if (base.initWithTexture(aTexture))
     {
         m_state = PaddleState.kPaddleStateUngrabbed;
     }
     return true;
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:8,代码来源:Paddle.cs

示例9: create

 public static CCMotionStreak create(float fade, float minSeg, float stroke, ccColor3B color, CCTexture2D texture)
 {
     CCMotionStreak pRet = new CCMotionStreak();
     if (pRet.initWithFade(fade, minSeg, stroke, color, texture))
     {
         return pRet;
     }
     return null;
 }
开发者ID:Ratel13,项目名称:cocos2d-x-for-xna,代码行数:9,代码来源:CCMotionStreak.cs

示例10: Create

 public static CCTiledGrid3D Create(CCGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
 {
     var pRet = new CCTiledGrid3D();
     if (pRet.InitWithSize(gridSize, pTexture, bFlipped))
     {
         return pRet;
     }
     return null;
 }
开发者ID:homocury,项目名称:cocos2d-xna,代码行数:9,代码来源:CCTiledGrid3D.cs

示例11: gridWithSize

        public static new CCTiledGrid3D gridWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            CCTiledGrid3D pRet = new CCTiledGrid3D();

            if (pRet.initWithSize(gridSize, pTexture, bFlipped))
            {
                return pRet;
            }

            return null;
        }
开发者ID:hiceka,项目名称:cocos2d-x-for-xna,代码行数:11,代码来源:CCTiledGrid3D.cs

示例12: afterRender

        public void afterRender(CCTexture2D pTexture)
        {
            // If the gles version is lower than GLES_VER_1_0,
            // all the functions in CCGrabber return directly.
            if (m_eGlesVersion <= CCGlesVersion.GLES_VER_1_0)
            {
                return;
            }

            //ccglBindFramebuffer(CC_GL_FRAMEBUFFER, m_oldFBO);
            //glColorMask(true, true, true, true);	// #631
        }
开发者ID:ChowZenki,项目名称:cocos2d-x-for-xna,代码行数:12,代码来源:CCGrabber.cs

示例13: afterRender

        public void afterRender(ref CCTexture2D pTexture)
        {
            // If the gles version is lower than GLES_VER_1_0,
            // all the functions in CCGrabber return directly.
            if (m_eGlesVersion <= CCGlesVersion.GLES_VER_1_0)
            {
                return;
            }

            CCApplication.sharedApplication().GraphicsDevice.SetRenderTarget(null);
            pTexture.texture2D = m_RenderTarget2D;

            //ccglBindFramebuffer(CC_GL_FRAMEBUFFER, m_oldFBO);
            //glColorMask(true, true, true, true);	// #631
        }
开发者ID:hiceka,项目名称:cocos2d-x-for-xna,代码行数:15,代码来源:CCGrabber.cs

示例14: gridWithSize

        public static CCGridBase gridWithSize(ccGridSize gridSize, CCTexture2D texture, bool flipped)
        {
            CCGridBase pGridBase = new CCGridBase();

            if (pGridBase != null)
            {
                if (pGridBase.initWithSize(gridSize, texture, flipped))
                {
                    //pGridBase->autorelease();
                }
                else
                {
                    //CC_SAFE_RELEASE_NULL(pGridBase);
                }
            }

            return pGridBase;
        }
开发者ID:ChowZenki,项目名称:cocos2d-x-for-xna,代码行数:18,代码来源:CCGridBase.cs

示例15: gridWithSize

        public static CCTiledGrid3D gridWithSize(ccGridSize gridSize, CCTexture2D pTexture, bool bFlipped)
        {
            CCTiledGrid3D pRet = new CCTiledGrid3D();

            if (pRet != null)
            {
                if (pRet.initWithSize(gridSize, pTexture, bFlipped))
                {
                    //pRet->autorelease();
                }
                else
                {
                    //delete pRet;
                    pRet = null;
                }
            }

            return pRet;
        }
开发者ID:ChowZenki,项目名称:cocos2d-x-for-xna,代码行数:19,代码来源:CCTiledGrid3D.cs


注:本文中的cocos2d.CCTexture2D类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。