您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CC_CONTENT_SCALE_FACTOR函数代码示例

51自学网 2021-06-01 19:57:35
  C++
这篇教程C++ CC_CONTENT_SCALE_FACTOR函数代码示例写得很实用,希望能帮到您。

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

在下文中一共展示了CC_CONTENT_SCALE_FACTOR函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: load

CCSPXFileData* CCSPXLoader::load(const char* spxPath) {	unsigned long len;	string mappedPath = CCUtils::mapLocalPath(spxPath);	char* data = (char*)CCFileUtils::sharedFileUtils()->getFileData(mappedPath.c_str(), "rb", &len);	CCSPXFileData* spx = load(data, (size_t)len, 1 / CC_CONTENT_SCALE_FACTOR());	spx->m_path = spxPath;	free(data);	return spx;}
开发者ID:WilliamRen,项目名称:cocos2dx-better,代码行数:9,


示例2: ccDrawPoint

void ccDrawPoint(const CCPoint& point){	ccVertex2F p = {point.x * CC_CONTENT_SCALE_FACTOR(), point.y * CC_CONTENT_SCALE_FACTOR() };	// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY	// Needed states: GL_VERTEX_ARRAY, 	// Unneeded states: GL_TEXTURE_2D, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY		glDisable(GL_TEXTURE_2D);	glDisableClientState(GL_TEXTURE_COORD_ARRAY);	glDisableClientState(GL_COLOR_ARRAY);		glVertexPointer(2, GL_FLOAT, 0, &p);		glDrawArrays(GL_POINTS, 0, 1);	// restore default state	glEnableClientState(GL_COLOR_ARRAY);	glEnableClientState(GL_TEXTURE_COORD_ARRAY);	glEnable(GL_TEXTURE_2D);	}
开发者ID:136446529,项目名称:Tiny-Wings-Remake-on-Android,代码行数:18,


示例3: ccpMult

void CCNode::setPositionInPixels(CCPoint newPosition){    m_tPositionInPixels = newPosition;	if ( CC_CONTENT_SCALE_FACTOR() == 1)	{		m_tPosition = m_tPositionInPixels;	}	else	{		m_tPosition = ccpMult(newPosition, 1/CC_CONTENT_SCALE_FACTOR());	}	m_bIsTransformDirty = m_bIsInverseDirty = true;#if CC_NODE_TRANSFORM_USING_AFFINE_MATRIX	m_bIsTransformGLDirty = true;#endif // CC_NODE_TRANSFORM_USING_AFFINE_MATRIX}
开发者ID:BigHand,项目名称:cocos2d-x,代码行数:19,


示例4: CC_CONTENT_SCALE_FACTOR

void CCCamera::setCenterXYZ(float fCenterX, float fCenterY, float fCenterZ){	float scale = CC_CONTENT_SCALE_FACTOR();	m_fCenterX = fCenterX * scale;	m_fCenterY = fCenterY * scale;	m_fCenterZ = fCenterZ * scale;	m_bDirty = true;}
开发者ID:noriter,项目名称:nit,代码行数:10,


示例5: addChild

//------------------------------------------------------------------//// Rookie Guide Layer////------------------------------------------------------------------void CommonRookieGuide::onEnter(){    CommonDemo::onEnter();        CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();	CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();		CCSprite* g1 = CCSprite::create("Images/grossini.png");	g1->setPosition(ccp(origin.x + visibleSize.width / 4,                        origin.y + visibleSize.height / 2));	addChild(g1);        CCSprite* g2 = CCSprite::create("Images/grossini.png");	g2->setPosition(ccp(origin.x + visibleSize.width * 3 / 4,                        origin.y + visibleSize.height / 2));	addChild(g2);        // create rookie guide    CCSimpleRookieGuide* rg = CCSimpleRookieGuide::create();        // set bg    rg->setBgColor(ccc4(0xff, 0, 0, 0x4f));        // add region    rg->addRegion(g2,                  CCCallFunc::create(this, callfunc_selector(CommonRookieGuide::onGuideClicked)));        // set arrow    rg->setArrow(CCSprite::create("Images/f1.png"));    rg->pointToRegionCenter(0, 100 / CC_CONTENT_SCALE_FACTOR(), 200);        // set hint    CCRichLabelTTF* hint = CCRichLabelTTF::create("[color=0xff0000ff]This is rookie guide, you MUST click it![/color]",                                                  "Helvetica",                                                  24 / CC_CONTENT_SCALE_FACTOR(),                                                  CCSizeMake(150 / CC_CONTENT_SCALE_FACTOR(), 0),                                                  kCCTextAlignmentLeft);    rg->setHint(hint);    rg->shiftHint(-80 / CC_CONTENT_SCALE_FACTOR(), -20 / CC_CONTENT_SCALE_FACTOR());        // add guide layer, must add it after set    addChild(rg);}
开发者ID:terryblood,项目名称:cocos2dx-better,代码行数:48,


示例6: CCAssert

bool CCLabelAtlas::initWithString(const char *theString, const char *fntFile){  std::string pathStr = CCFileUtils::sharedFileUtils()->fullPathForFilename(fntFile);  std::string relPathStr = pathStr.substr(0, pathStr.find_last_of("/"))+"/";  CCDictionary *dict = CCDictionary::createWithContentsOfFile(pathStr.c_str());    CCAssert(((CCString*)dict->objectForKey("version"))->intValue() == 1, "Unsupported version. Upgrade cocos2d version");      std::string texturePathStr = relPathStr + ((CCString*)dict->objectForKey("textureFilename"))->getCString();  CCString *textureFilename = CCString::create(texturePathStr);  unsigned int width = ((CCString*)dict->objectForKey("itemWidth"))->intValue() / CC_CONTENT_SCALE_FACTOR();  unsigned int height = ((CCString*)dict->objectForKey("itemHeight"))->intValue() / CC_CONTENT_SCALE_FACTOR();  unsigned int startChar = ((CCString*)dict->objectForKey("firstChar"))->intValue();    this->initWithString(theString, textureFilename->getCString(), width, height, startChar);      return true;}
开发者ID:live106,项目名称:cocos2d-x-AoB,代码行数:19,


示例7: CC_CONTENT_SCALE_FACTOR

void CCEGLView::setScissorInPoints(float x, float y, float w, float h) {	//TODO	if (bIsInit) {		float factor = m_fScreenScaleFactor / CC_CONTENT_SCALE_FACTOR();		glScissor((GLint)(x * factor) + m_rcViewPort.origin.x,				(GLint)(y * factor) + m_rcViewPort.origin.y,				(GLint)(w * factor),				(GLint)(h * factor));	}}
开发者ID:Wartortle,项目名称:cocos2d-x,代码行数:10,


示例8: ccpMult

void CCBlade::push(CCPoint v){	if (isReset) 	{		return;	}    if (CC_CONTENT_SCALE_FACTOR() != 1.0f) {        v = ccpMult(v, CC_CONTENT_SCALE_FACTOR());    }	#if USE_LAGRANGE    if (path.size() == 0) 	{		path.insert(path.begin(),v);                return;    }        CCPoint first = path[0];    if (ccpDistance(v, first) < DISTANCE_TO_INTERPOLATE) {        path.insert(path.begin(),v);        if (path.size() > pointLimit) {            path.pop_back();        }    }else{        int num = ccpDistance(v, first) / DISTANCE_TO_INTERPOLATE;        CCPoint iv = ccpMult(ccpSub(v, first), (float)1./(num + 1));		for (int i = 1; i <= num + 1; i++) {            path.insert(path.begin(),ccpAdd(first, ccpMult(iv, i)));		}		while (path.size() > pointLimit) {			path.pop_back();		}    }#else // !USE_LAGRANGE	path.push_front(v);	if (path.size() > pointLimit) {		path.pop_back();	}#endif // !USE_LAGRANGE	this->populateVertices();}
开发者ID:farmisen,项目名称:PixelPerfectCollision,代码行数:42,


示例9: glViewport

void CCGridBase::set2DProjection(){    CCDirector *director = CCDirector::sharedDirector();    CCSize    size = director->getWinSizeInPixels();    glViewport(0, 0, (GLsizei)(size.width * CC_CONTENT_SCALE_FACTOR()), (GLsizei)(size.height * CC_CONTENT_SCALE_FACTOR()) );    kmGLMatrixMode(KM_GL_PROJECTION);    kmGLLoadIdentity();    kmMat4 orthoMatrix;    kmMat4OrthographicProjection(&orthoMatrix, 0, size.width * CC_CONTENT_SCALE_FACTOR(), 0, size.height * CC_CONTENT_SCALE_FACTOR(), -1, 1);    kmGLMultMatrix( &orthoMatrix );    kmGLMatrixMode(KM_GL_MODELVIEW);    kmGLLoadIdentity();    ccSetProjectionMatrixDirty();}
开发者ID:acc85,项目名称:cocos2d-x,代码行数:20,


示例10: CC_CONTENT_SCALE_FACTOR

void Label::updateBMFontScale(){    auto font = _fontAtlas->getFont();    if (_currentLabelType == LabelType::BMFONT) {        FontFNT *bmFont = (FontFNT*)font;        float originalFontSize = bmFont->getOriginalFontSize();        _bmfontScale = _bmFontSize * CC_CONTENT_SCALE_FACTOR() / originalFontSize;    }else{        _bmfontScale = 1.0f;    }}
开发者ID:602147629,项目名称:PlanetWar,代码行数:11,


示例11: CCAssert

bool CCLabelTTF::initWithString(const char *label, const CCSize& dimensions, CCTextAlignment alignment, const char *fontName, float fontSize){    CCAssert(label != NULL, "");    if (CCSprite::init())    {        // shader program        setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(SHADER_PROGRAM));        m_tDimensions = CCSizeMake( dimensions.width * CC_CONTENT_SCALE_FACTOR(), dimensions.height * CC_CONTENT_SCALE_FACTOR() );        m_eAlignment = alignment;        CC_SAFE_DELETE(m_pFontName);        m_pFontName = new std::string(fontName);        m_fFontSize = fontSize * CC_CONTENT_SCALE_FACTOR();        this->setString(label);        return true;    }    return false;}
开发者ID:Aaron-Teng,项目名称:AnalyticX,代码行数:20,


示例12: CC_CONTENT_SCALE_FACTOR

void CCEGLView::setViewPortInPoints(float x, float y, float w, float h){    if (m_pEGL)    {        float factor = m_fScreenScaleFactor / CC_CONTENT_SCALE_FACTOR();        glViewport((GLint)(x * factor) + m_rcViewPort.X(),            (GLint)(y * factor) + m_rcViewPort.Y(),            (GLint)(w * factor),            (GLint)(h * factor));    }}
开发者ID:flyingpacer,项目名称:cocos2d-x-samples,代码行数:11,


示例13: CC_CONTENT_SCALE_FACTOR

/// override contentSizevoid CCLayerColor::setContentSize(const CCSize& size){	float scale = CC_CONTENT_SCALE_FACTOR();	m_pSquareVertices[1].x = size.width * scale;	m_pSquareVertices[2].y = size.height * scale;	m_pSquareVertices[3].x = size.width * scale;	m_pSquareVertices[3].y = size.height * scale;	CCLayer::setContentSize(size);}
开发者ID:noriter,项目名称:nit,代码行数:12,


示例14: glBindFramebuffer

void CCRenderTexture::end(){    glBindFramebuffer(GL_FRAMEBUFFER, m_nOldFBO);    kmGLPopMatrix();    CCDirector *director = CCDirector::sharedDirector();    CCSize size = director->getWinSizeInPixels();    // restore viewport    glViewport(0, 0, GLsizei(size.width * CC_CONTENT_SCALE_FACTOR()), GLsizei(size.height * CC_CONTENT_SCALE_FACTOR()));    // special viewport for 3d projection + retina display    if ( director->getProjection() == kCCDirectorProjection3D && CC_CONTENT_SCALE_FACTOR() != 1 )    {        glViewport((GLsizei)(-size.width/2), (GLsizei)(-size.height/2), (GLsizei)(size.width * CC_CONTENT_SCALE_FACTOR()), (GLsizei)(size.height * CC_CONTENT_SCALE_FACTOR()));    }    director->setProjection(director->getProjection());}
开发者ID:342261733,项目名称:cocos2d-x,代码行数:20,


示例15: CCASSERT

bool LabelAtlas::initWithString(const std::string& theString, const std::string& fntFile){    std::string pathStr = FileUtils::getInstance()->fullPathForFilename(fntFile);    std::string relPathStr = pathStr.substr(0, pathStr.find_last_of("/"))+"/";        ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(pathStr.c_str());    CCASSERT(dict["version"].asInt() == 1, "Unsupported version. Upgrade cocos2d version");    std::string textureFilename = relPathStr + dict["textureFilename"].asString();    unsigned int width = dict["itemWidth"].asInt() / CC_CONTENT_SCALE_FACTOR();    unsigned int height = dict["itemHeight"].asInt() / CC_CONTENT_SCALE_FACTOR();    unsigned int startChar = dict["firstChar"].asInt();    this->initWithString(theString, textureFilename.c_str(), width, height, startChar);    return true;}
开发者ID:0xiaohui00,项目名称:Cocos2dx-Wechat,代码行数:20,


示例16: Size

void Label::enableShadow(const Color4B& shadowColor /* = Color4B::BLACK */,const Size &offset /* = Size(2 ,-2)*/, int blurRadius /* = 0 */){    _shadowEnabled = true;    _shadowDirty = true;    auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();    _shadowOffset.width = offset.width * contentScaleFactor;    _shadowOffset.height = offset.height * contentScaleFactor;    //TODO: support blur for shadow    _shadowColor3B.r = shadowColor.r;    _shadowColor3B.g = shadowColor.g;    _shadowColor3B.b = shadowColor.b;    _shadowOpacity = shadowColor.a;    if (!_systemFontDirty && !_contentDirty && _textSprite)    {        auto fontDef = _getFontDefinition();        if (_shadowNode)        {            if (shadowColor != _shadowColor4F)            {                _shadowNode->release();                _shadowNode = nullptr;                createShadowSpriteForSystemFont(fontDef);            }            else            {                _shadowNode->setPosition(_shadowOffset.width, _shadowOffset.height);            }        }        else        {            createShadowSpriteForSystemFont(fontDef);        }    }    _shadowColor4F.r = shadowColor.r / 255.0f;    _shadowColor4F.g = shadowColor.g / 255.0f;    _shadowColor4F.b = shadowColor.b / 255.0f;    _shadowColor4F.a = shadowColor.a / 255.0f;    if (_currentLabelType == LabelType::BMFONT || _currentLabelType == LabelType::CHARMAP)    {        if (_shadowEnabled)        {            setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));        }         else        {            setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP));        }    }}
开发者ID:wade0317,项目名称:Calc,代码行数:54,


示例17: CC_CONTENT_SCALE_FACTOR

void CCEGLView::setScissorInPoints(float x, float y, float w, float h){    if (m_pEGL)    {        float factor = m_fScreenScaleFactor / CC_CONTENT_SCALE_FACTOR();        glScissor((GLint)(x * factor) + m_rcViewPort.left,            (GLint)(y * factor) + m_rcViewPort.top,            (GLint)(w * factor),            (GLint)(h * factor));    }}
开发者ID:9re,项目名称:cocos2d-x,代码行数:11,


示例18: _winSize

EnergyContainer::EnergyContainer() :_winSize(CCDirector::sharedDirector()->getWinSize()),_manager(GameManager::sharedGameManager()){    _energyX = _winSize.width * 0.1f;    _energyY = _winSize.height * 0.03f;            glLineWidth(ENERGY_DRAW * CC_CONTENT_SCALE_FACTOR());        }
开发者ID:shinriyo,项目名称:SadMemoryShooting,代码行数:12,


示例19: seconds

TimerSprite::TimerSprite(const float seconds) : seconds(seconds), secondsLeft(seconds), on(true), penalty(false){    const float scale = CC_CONTENT_SCALE_FACTOR();	const CCSize screenSize = CCDirector::sharedDirector()->getWinSize();    width = screenSize.width*3/5;    const LineParams backgroundParams = {        .start = vec2(-width/2*scale, 0),        .end = vec2(width/2*scale, 0),        .edgeCenterDistances = makeVector((float[]){scale, 3*scale + 1}),        .edgeColors = makeVector((vec4[]){vec4(1,1,1,0), vec4(1,1,1,0.2f)})    };
开发者ID:gitbaby,项目名称:CircleLabyrinth,代码行数:12,


示例20: CCLOG

void CCEGLView::setViewPortInPoints(float x, float y, float w, float h) {//	TODO    CCLOG("%s(%d):%s called", __FILE__, __LINE__, __FUNCTION__);//    if (bIsInit)    {		float factor = m_fScreenScaleFactor / CC_CONTENT_SCALE_FACTOR();        glViewport((GLint)(x * factor) + m_rcViewPort.origin.x,                (GLint)(y * factor) + m_rcViewPort.origin.y,				(GLint)(w * factor),				(GLint)(h * factor));	}}
开发者ID:FlyingFishBird,项目名称:cocos2d-x-qt-1,代码行数:12,


示例21: CCAssert

	bool CCLabelTTF::initWithString(const char *label, const CCSize& dimensions, CCTextAlignment alignment, const char *fontName, float fontSize)	{		CCAssert(label != NULL, "");		if (CCSprite::init())		{			m_tDimensions = CCSizeMake( dimensions.width * CC_CONTENT_SCALE_FACTOR(), dimensions.height * CC_CONTENT_SCALE_FACTOR() );			m_eAlignment = alignment;            if (m_pFontName)            {                delete m_pFontName;                m_pFontName = NULL;            }            m_pFontName = new std::string(fontName);			m_fFontSize = fontSize * CC_CONTENT_SCALE_FACTOR();			this->setString(label);			return true;		}		return false;	}
开发者ID:tungt84,项目名称:cocos2d-blackberry,代码行数:21,


示例22: CC_CONTENT_SCALE_FACTOR

void LabelTTFLoader::onHandlePropTypePosition(cocos2d::Node * pNode,cocos2d:: Node * pParent, const char* pPropertyName, cocos2d::Point pPosition, CCBReader * ccbReader) {        if(strcmp(pPropertyName, PROPERTY_SHADOWOFFSET) == 0) {        auto contentScaleFactor = CC_CONTENT_SCALE_FACTOR();        this->_shadowOffset = Size(pPosition.x / contentScaleFactor, pPosition.y / contentScaleFactor);        		((Label *)pNode)->enableShadow(this->_shadowColor, this->_shadowOffset, this->_shadowBlurRadius);        	} else {        NodeLoader::onHandlePropTypePosition(pNode, pParent, pPropertyName, pPosition, ccbReader);    }}
开发者ID:eiji11,项目名称:takyan,代码行数:12,


示例23: CC_CONTENT_SCALE_FACTOR

void CCTransitionRadialCCW::onEnter(){	CCTransitionScene::onEnter();	// create a transparent color layer	// in which we are going to add our rendertextures	CCSize size = CCDirector::sharedDirector()->getWinSize();	// create the second render texture for outScene	m_OutRT = CCRenderTexture::renderTextureWithWidthAndHeight((int)size.width, (int)size.height);	if (NULL == m_OutRT)		return;		m_OutRT->retain();	m_OutRT->getSprite()->setAnchorPoint(ccp(0.5f,0.5f));	m_OutRT->setPosition(ccp(size.width/2, size.height/2));	m_OutRT->setAnchorPoint(ccp(0.5f,0.5f));	//	We need the texture in RenderTexture.	CCProgressTimer *outNode = CCProgressTimer::progressWithTexture(m_OutRT->getSprite()->getTexture());	// but it's flipped upside down so we flip the sprite	outNode->getSprite()->setFlipY(true);	// fix content scale factor for radial texture	CCRect rect = CCRectZero;	rect.size = m_OutRT->getSprite()->getTexture()->getContentSize();	outNode->getSprite()->setTextureRect(rect, false);	float scale = 1.0f / CC_CONTENT_SCALE_FACTOR();	rect.size.width *= scale;	rect.size.height *= scale;	outNode->setContentSize(rect.size);	//	Return the radial type that we want to use	outNode->setType(radialType());	outNode->setPercentage(100.f);	outNode->setPosition(ccp(size.width/2, size.height/2));	outNode->setAnchorPoint(ccp(0.5f,0.5f));	// create the blend action	CCAction * layerAction = CCSequence::actions	(		CCProgressFromTo::actionWithDuration(m_fDuration, 100.0f, 0.0f),		CCEventCall::actionWithTarget(NULL, createEventHandler(this, &CCTransitionScene::_finish)),		NULL	);	// run the blend action	outNode->runAction(layerAction);	// add the layer (which contains our two rendertextures) to the scene	this->addChild(outNode, 2, kSceneRadial);}
开发者ID:noriter,项目名称:nit,代码行数:52,


示例24: assert

	bool CCLabelTTF::initWithString(const char *label, const char *fontName, float fontSize)	{		assert(label != NULL);		if (CCSprite::init())		{			m_tDimensions = CGSizeZero;			m_sFontName = fontName;			m_fFontSize = fontSize * CC_CONTENT_SCALE_FACTOR();			this->setString(label);			return true;		}		return false;	}
开发者ID:geniikw,项目名称:myFirst2DGame,代码行数:13,


示例25: CCSizeMake

void CCNode::setContentSize(CCSize size){	if( ! CCSize::CCSizeEqualToSize(size, m_tContentSize) ) 	{		m_tContentSize = size;        if( CC_CONTENT_SCALE_FACTOR() == 1 )        {            m_tContentSizeInPixels = m_tContentSize;        }        else        {            m_tContentSizeInPixels = CCSizeMake( size.width * CC_CONTENT_SCALE_FACTOR(), size.height * CC_CONTENT_SCALE_FACTOR() );        }		m_tAnchorPointInPixels = ccp( m_tContentSizeInPixels.width * m_tAnchorPoint.x, m_tContentSizeInPixels.height * m_tAnchorPoint.y );		m_bIsTransformDirty = m_bIsInverseDirty = true;#ifdef CC_NODE_TRANSFORM_USING_AFFINE_MATRIX		m_bIsTransformGLDirty = true;#endif	}}
开发者ID:BigHand,项目名称:cocos2d-x,代码行数:22,


示例26: ccDrawLine

void ccDrawLine(const CCPoint& origin, const CCPoint& destination){	ccVertex2F vertices[2] =     {        {origin.x * CC_CONTENT_SCALE_FACTOR(), origin.y * CC_CONTENT_SCALE_FACTOR()},        {destination.x * CC_CONTENT_SCALE_FACTOR(), destination.y * CC_CONTENT_SCALE_FACTOR()},    };		// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY	// Needed states: GL_VERTEX_ARRAY, 	// Unneeded states: GL_TEXTURE_2D, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY		glDisable(GL_TEXTURE_2D);	glDisableClientState(GL_TEXTURE_COORD_ARRAY);	glDisableClientState(GL_COLOR_ARRAY);		glVertexPointer(2, GL_FLOAT, 0, vertices);		glDrawArrays(GL_LINES, 0, 2);		// restore default state	glEnableClientState(GL_COLOR_ARRAY);	glEnableClientState(GL_TEXTURE_COORD_ARRAY);	glEnable(GL_TEXTURE_2D);	}
开发者ID:caivega,项目名称:cocos2d-x,代码行数:23,


示例27: string

const std::string LHSettings::imagePath(const std::string& image){            std::string computedFile = image;    if(isIpad())    {       // CCLog("IS IPAD");                if(device != 1 && device != 3)//if ipad only then we dont need to apply transformations        {            if(CC_CONTENT_SCALE_FACTOR() == 2)            {                //we have ipad retina                size_t found;                found=computedFile.find_last_of(".");                                #if COCOS2D_VERSION < 0x00020000                computedFile.insert(found, hd2xSuffix);                #endif            }            else {                //we have normal ipad - lets use the HD image                                size_t found;                found=computedFile.find_last_of(".");                #if COCOS2D_VERSION < 0x00020000                computedFile.insert(found, hdSuffix);                #endif            }        }        #if COCOS2D_VERSION >= 0x00020100        const char* fullpath = CCFileUtils::sharedFileUtils()->fullPathForFilename(computedFile.c_str()).c_str();        #elif COCOS2D_VERSION >= 0x00020000        const char* fullpath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(computedFile.c_str());#else        const char* fullpath = CCFileUtils::fullPathFromRelativePath(computedFile.c_str());#endif                std::ifstream infile;        infile.open (fullpath);        if(true == infile.is_open()){ //IF THIS FAILS IT MEANS WE HAVE NO -hd file            infile.close();            return std::string(fullpath);        }    }    //    CCLog("RETURNING %s", image.c_str());        return image;}
开发者ID:AaronlAvaf,项目名称:Nextpeer-UFORUN,代码行数:50,


示例28: getContentSize

void CCProgressHUD::draw() {    CCLayerColor::draw();        // draw panel    const CCSize& contentSize = getContentSize();	CCPoint size = ccp(m_panelSize.width, m_panelSize.height);	if(m_forceSquare) {		size.x = size.y = MAX(size.x, size.y);	}    CCPoint origin = ccp(contentSize.width / 2 - size.x / 2,                         contentSize.height / 2 - size.y / 2);    CCPoint dest = ccpAdd(origin, size);    ccDrawSolidRoundRect(origin, dest, 15 / CC_CONTENT_SCALE_FACTOR(), m_panelColor);}
开发者ID:boruis,项目名称:cocos2dx-classical,代码行数:14,



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


C++ CC_CONTINUE_IF函数代码示例
C++ CC_CALLBACK_1函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。