本文整理汇总了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);
}
示例2: CCSprite
public CCSprite(CCTexture2D texture)
{
if (!InitWithTexture(texture))
{
CCLog.Log("CCSprite (CCTexture2D texture): Problems initializing class");
}
}
示例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();
}
示例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;
}
示例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;
}
示例6: ballWithTexture
public static Ball ballWithTexture(CCTexture2D aTexture)
{
Ball pBall = new Ball();
pBall.InitWithTexture(aTexture);
//pBall->autorelease();
return pBall;
}
示例7: paddleWithTexture
public static Paddle paddleWithTexture(CCTexture2D aTexture)
{
Paddle pPaddle = new Paddle();
pPaddle.initWithTexture(aTexture);
//pPaddle->autorelease();
return pPaddle;
}
示例8: initWithTexture
public new bool initWithTexture(CCTexture2D aTexture)
{
if (base.initWithTexture(aTexture))
{
m_state = PaddleState.kPaddleStateUngrabbed;
}
return true;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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
}
示例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;
}
示例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;
}