这篇教程C++ CC_RECT_POINTS_TO_PIXELS函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CC_RECT_POINTS_TO_PIXELS函数的典型用法代码示例。如果您正苦于以下问题:C++ CC_RECT_POINTS_TO_PIXELS函数的具体用法?C++ CC_RECT_POINTS_TO_PIXELS怎么用?C++ CC_RECT_POINTS_TO_PIXELS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CC_RECT_POINTS_TO_PIXELS函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CC_RECT_POINTS_TO_PIXELS void Scale9Sprite::createSlicedSprites() { //todo create sliced sprite if (_scale9Enabled) { Texture2D *tex = _scale9Image ? _scale9Image->getTexture() : nullptr; if (tex == nullptr) { return; } if (_renderingType == RenderingType::SIMPLE) { this->configureSimpleModeRendering(); } auto capInsets = CC_RECT_POINTS_TO_PIXELS(_capInsetsInternal); auto textureRect = CC_RECT_POINTS_TO_PIXELS(_spriteRect); auto spriteRectSize = _spriteRect.size; auto originalSize = CC_SIZE_POINTS_TO_PIXELS(_originalSize); auto offset = CC_POINT_POINTS_TO_PIXELS(_offset); Vec4 offsets; offsets.x = offset.x + (originalSize.width - textureRect.size.width) / 2; offsets.w = offset.y + (originalSize.height - textureRect.size.height) / 2; offsets.z = originalSize.width - textureRect.size.width - offsets.x; offsets.y = originalSize.height - textureRect.size.height - offsets.w; //handle .9.png if (_isPatch9) { originalSize = Size(originalSize.width - 2, originalSize.height-2); } if(capInsets.equals(Rect::ZERO)) { capInsets = Rect(originalSize.width/3, originalSize.height/3, originalSize.width/3, originalSize.height/3); } auto uv = this->calculateUV(tex, capInsets, originalSize, offsets); auto vertices = this->calculateVertices(capInsets, originalSize, offsets); auto triangles = this->calculateTriangles(uv, vertices); _scale9Image->getPolygonInfo().setTriangles(triangles); } }
开发者ID:funseek,项目名称:TransitionExample,代码行数:49,
示例2: CC_RECT_POINTS_TO_PIXELSvoid SuperAnimSprite::SetTexture(CCTexture2D *theTexture, CCRect theTextureRect){ if (theTexture == NULL) { return; } if (mTexture != NULL) { mTexture->release(); mTexture = NULL; } // retain this texture in case removed by removeUnusedTextures(); theTexture->retain(); mTexture = theTexture; // Set Texture coordinates CCRect theTexturePixelRect = CC_RECT_POINTS_TO_PIXELS(theTextureRect); float aTextureWidth = (float)mTexture->getPixelsWide(); float aTextureHeight = (float)mTexture->getPixelsHigh(); float aLeft, aRight, aTop, aBottom; aLeft = theTexturePixelRect.origin.x / aTextureWidth; aRight = (theTexturePixelRect.origin.x + theTexturePixelRect.size.width) / aTextureWidth; aTop = theTexturePixelRect.origin.y / aTextureHeight; aBottom = (theTexturePixelRect.origin.y + theTexturePixelRect.size.height) / aTextureHeight; mQuad.bl.texCoords.u = aLeft; mQuad.bl.texCoords.v = aBottom; mQuad.br.texCoords.u = aRight; mQuad.br.texCoords.v = aBottom; mQuad.tl.texCoords.u = aLeft; mQuad.tl.texCoords.v = aTop; mQuad.tr.texCoords.u = aRight; mQuad.tr.texCoords.v = aTop; // Set position //float x1 = 0; //float y1 = 0; //float x2 = x1 + theTextureRect.size.width; //float y2 = y1 + theTextureRect.size.height; float x1 = theTexturePixelRect.size.width * -0.5f; float y1 = theTexturePixelRect.size.height * -0.5f; float x2 = theTexturePixelRect.size.width * 0.5f; float y2 = theTexturePixelRect.size.height * 0.5f; mQuad.bl.vertices = vertex3(x1, y1, 0); mQuad.br.vertices = vertex3(x2, y1, 0); mQuad.tl.vertices = vertex3(x1, y2, 0); mQuad.tr.vertices = vertex3(x2, y2, 0); // Set color ccColor4B aDefaultColor = {255, 255, 255, 255}; mQuad.bl.colors = aDefaultColor; mQuad.br.colors = aDefaultColor; mQuad.tl.colors = aDefaultColor; mQuad.tr.colors = aDefaultColor;}
开发者ID:xiangry,项目名称:cocos2dx-classical,代码行数:60,
示例3: CC_RECT_POINTS_TO_PIXELSSpriteFrame* Sprite::getSpriteFrame() const{ return SpriteFrame::createWithTexture(_texture, CC_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, CC_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), CC_SIZE_POINTS_TO_PIXELS(_contentSize));}
开发者ID:AIRIA,项目名称:CreazyBomber,代码行数:8,
示例4: glEnable//---------------------------------------------------------------////void CLetterMoveLayer::preVisitWithClippingRect(CCRect clipRect){ if (!this->getIsVisible()) return; glEnable(GL_SCISSOR_TEST); CCDirector *director = CCDirector::sharedDirector(); CCSize size =director->getWinSize(); CCPoint origin = this->convertToWorldSpaceAR(clipRect.origin); CCPoint topRight =this->convertToWorldSpaceAR(ccpAdd(clipRect.origin, ccp(clipRect.size.width, clipRect.size.height))); CCRect scissorRect = CCRectMake(origin.x, origin.y, topRight.x-origin.x, topRight.y-origin.y); // transform the clipping rectangle to adjust to the current screen // orientation: the rectangle that has to be passed into glScissor is // always based on the coordinate system as if the device was held with the // home button at the bottom. the transformations account for different // device orientations and adjust the clipping rectangle to what the user // expects to happen. ccDeviceOrientation orientation =director->getDeviceOrientation(); switch (orientation) { case kCCDeviceOrientationPortrait: break; case kCCDeviceOrientationPortraitUpsideDown: scissorRect.origin.x = size.width-scissorRect.size.width-scissorRect.origin.x; scissorRect.origin.y = size.height-scissorRect.size.height-scissorRect.origin.y; break; case kCCDeviceOrientationLandscapeLeft: { float tmp = scissorRect.origin.x; scissorRect.origin.x = scissorRect.origin.y; scissorRect.origin.y = size.width-scissorRect.size.width-tmp; tmp = scissorRect.size.width; scissorRect.size.width = scissorRect.size.height; scissorRect.size.height = tmp; } break; case kCCDeviceOrientationLandscapeRight: { float tmp = scissorRect.origin.y; scissorRect.origin.y = scissorRect.origin.x; scissorRect.origin.x = size.height-scissorRect.size.height-tmp; tmp = scissorRect.size.width; scissorRect.size.width = scissorRect.size.height; scissorRect.size.height = tmp; } break; } // Handle Retina scissorRect = CC_RECT_POINTS_TO_PIXELS(scissorRect); glScissor((GLint) scissorRect.origin.x, (GLint) scissorRect.origin.y, (GLint) scissorRect.size.width, (GLint) scissorRect.size.height);}
开发者ID:JoeHu,项目名称:magicpet,代码行数:58,
示例5: CC_RECT_POINTS_TO_PIXELSSpriteFrame* MGRBlurSprite::getSpriteFrame() const{ if(nullptr != this->_spriteFrame) { return this->_spriteFrame; } return SpriteFrame::createWithTexture(_texture, CC_RECT_POINTS_TO_PIXELS(_rect), _rectRotated, CC_POINT_POINTS_TO_PIXELS(_unflippedOffsetPositionFromCenter), CC_SIZE_POINTS_TO_PIXELS(_contentSize));}
开发者ID:monguri,项目名称:RendererBasedCocos,代码行数:12,
示例6: CCASSERTRect AutoPolygon::getRealRect(const Rect& rect){ Rect realRect = rect; //check rect to see if its zero if(realRect.equals(Rect::ZERO)) { //if the instance doesn't have width and height, then the whole operation is kaput CCASSERT(_height && _width, "Please specify a width and height for this instance before using its functions"); realRect = Rect(0,0, _width, _height); } else{ //rect is specified, so convert to real rect realRect = CC_RECT_POINTS_TO_PIXELS(rect); } return realRect;}
开发者ID:Fuzesunshine,项目名称:CocosTest,代码行数:16,
示例7: CC_RECT_POINTS_TO_PIXELSvoid Sprite::setTextureCoords(Rect rect){ Texture2D *tex = _batchNode ? _textureAtlas->getTexture() : _texture; if (tex == nullptr) { return; } rect = CC_RECT_POINTS_TO_PIXELS(rect); float atlasWidth = (float)tex->getPixelsWide(); float atlasHeight = (float)tex->getPixelsHigh(); float left, right, top, bottom; if (_rectRotated) {#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); right = left+(rect.size.height*2-2)/(2*atlasWidth); top = (2*rect.origin.y+1)/(2*atlasHeight); bottom = top+(rect.size.width*2-2)/(2*atlasHeight);#else left = rect.origin.x/atlasWidth; right = (rect.origin.x+rect.size.height) / atlasWidth; top = rect.origin.y/atlasHeight; bottom = (rect.origin.y+rect.size.width) / atlasHeight;#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL if (_flippedX) { std::swap(top, bottom); } if (_flippedY) { std::swap(left, right); } _quad.bl.texCoords.u = left; _quad.bl.texCoords.v = top; _quad.br.texCoords.u = left; _quad.br.texCoords.v = bottom; _quad.tl.texCoords.u = right; _quad.tl.texCoords.v = top; _quad.tr.texCoords.u = right; _quad.tr.texCoords.v = bottom; } else {#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); right = left + (rect.size.width*2-2)/(2*atlasWidth); top = (2*rect.origin.y+1)/(2*atlasHeight); bottom = top + (rect.size.height*2-2)/(2*atlasHeight);#else left = rect.origin.x/atlasWidth; right = (rect.origin.x + rect.size.width) / atlasWidth; top = rect.origin.y/atlasHeight; bottom = (rect.origin.y + rect.size.height) / atlasHeight;#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL if(_flippedX) { std::swap(left, right); } if(_flippedY) { std::swap(top, bottom); } _quad.bl.texCoords.u = left; _quad.bl.texCoords.v = bottom; _quad.br.texCoords.u = right; _quad.br.texCoords.v = bottom; _quad.tl.texCoords.u = left; _quad.tl.texCoords.v = top; _quad.tr.texCoords.u = right; _quad.tr.texCoords.v = top; }}
开发者ID:253056965,项目名称:cocos2d-x-lite,代码行数:81,
示例8: offsetTexModule *Sprite::ensureTexModule() { auto tmMgr = TextureManager::getInstance(); TexModule *tm = nullptr; auto textureFilename = tmMgr->getTextureFilename(_texture); Vec2 offset(Vec2::ZERO); if (textureFilename.find(".md") == std::string::npos) { auto image = tmMgr->getImage(textureFilename); tm = image->getTexModule(); } else { auto module = tmMgr->getModule(textureFilename); if (!tmMgr->hasCalculatedTexCoord(_texCoordId)) { _moduleId = -1; for (int i = 0; i < module->getModuleCount(); ++i) { Rect rect = module->getModuleRect(i); if (!(_rect.getMinX() < rect.getMinX() || _rect.getMinY() < rect.getMinY() || _rect.getMaxX() > rect.getMaxX() || _rect.getMaxY() > rect.getMaxY())) { _moduleId = i; break; } } } if (_moduleId >= 0) { tm = module->getTexModule(_moduleId); offset = module->getModuleOffset(_moduleId); } } if (tm && !tmMgr->hasCalculatedTexCoord(_texCoordId)) { auto rect = CC_RECT_POINTS_TO_PIXELS(_rect); rect.origin = (rect.origin - offset) + Vec2(tm->x, tm->y); float atlasWidth = (float) tm->tex->getPixelsWide(); float atlasHeight = (float) tm->tex->getPixelsHigh(); float left = (rect.origin.x + ((_edgeFlag & kEdgeFlagLeft) ? 0.5f : 0)) / atlasWidth; float right = (rect.origin.x + rect.size.width - ((_edgeFlag & kEdgeFlagRight) ? 0.5f : 0)) / atlasWidth; float top = (rect.origin.y + ((_edgeFlag & kEdgeFlagTop) ? 0.5f : 0)) / atlasHeight; float bottom = (rect.origin.y + rect.size.height - ((_edgeFlag & kEdgeFlagBottom) ? 0.5f : 0)) / atlasHeight; if(_flippedX) { std::swap(left, right); } if(_flippedY) { std::swap(top, bottom); } _quad.bl.texCoords.u = left; _quad.bl.texCoords.v = bottom; _quad.br.texCoords.u = right; _quad.br.texCoords.v = bottom; _quad.tl.texCoords.u = left; _quad.tl.texCoords.v = top; _quad.tr.texCoords.u = right; _quad.tr.texCoords.v = top; tmMgr->calculatedTexCoord(_texCoordId, tm); } return tm;}
开发者ID:eiasy,项目名称:DouPo,代码行数:67,
示例9: CC_RECT_POINTS_TO_PIXELSbool CCSpriteFrame::initWithTextureFilename(const char* filename, const CCRect& rect){ CCRect rectInPixels = CC_RECT_POINTS_TO_PIXELS( rect ); return initWithTextureFilename(filename, rectInPixels, false, CCPointZero, rectInPixels.size);}
开发者ID:boruis,项目名称:cocos2dx-classical,代码行数:5,
示例10: CC_CONTENT_SCALE_FACTORbool LHAnimationFrameInfo::initWithDictionary(LHDictionary* dictionary, LHSprite* sprite){ if(NULL == dictionary) return false; delayPerUnit = dictionary->floatForKey("delayPerUnit"); offset = dictionary->pointForKey("offset"); offset.x *= CC_CONTENT_SCALE_FACTOR(); offset.y *= CC_CONTENT_SCALE_FACTOR(); notifications = NULL; if(dictionary->objectForKey("notifications")) {#if COCOS2D_VERSION >= 0x00020000 notifications = (LHDictionary*)CCDictionary::createWithDictionary(dictionary->dictForKey("notifications"));#else notifications = (LHDictionary*)CCDictionary<std::string, CCObject*>::dictionaryWithDictionary(dictionary->dictForKey("notifications"));#endif notifications->retain(); } spriteframeName = std::string(dictionary->stringForKey("spriteframe")); rect = dictionary->rectForKey("Frame"); rect = CC_RECT_POINTS_TO_PIXELS(rect); rect = LHSettings::sharedInstance()->transformedTextureRect(rect, sprite->getImageFile()); spriteFrameOffset = dictionary->pointForKey("TextureOffset"); spriteFrameOffset.x *= CC_CONTENT_SCALE_FACTOR(); spriteFrameOffset.y *= CC_CONTENT_SCALE_FACTOR(); if(LHSettings::sharedInstance()->isHDImage(sprite->getImageFile())){ spriteFrameOffset.x *= 2.0f; spriteFrameOffset.y *= 2.0f; } CCPoint tempOffset = spriteFrameOffset; tempOffset.x += offset.x; tempOffset.y -= offset.y; offset = tempOffset; rectIsRotated = dictionary->boolForKey("IsRotated"); spriteFrameSize = dictionary->sizeForKey("SpriteSize"); spriteFrameSize.width *= CC_CONTENT_SCALE_FACTOR(); spriteFrameSize.height*= CC_CONTENT_SCALE_FACTOR(); if(LHSettings::sharedInstance()->isHDImage(sprite->getImageFile())){ spriteFrameSize.width *= 2.0f; spriteFrameSize.height*= 2.0f; } sprFrame = NULL; createSpriteFrameWithSprite(sprite); return true;}
开发者ID:AaronlAvaf,项目名称:Nextpeer-UFORUN,代码行数:64,
示例11: CC_RECT_POINTS_TO_PIXELSbool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rect& rect){ Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS( rect ); return initWithTextureFilename(filename, rectInPixels, false, Vec2::ZERO, rectInPixels.size);}
开发者ID:hugohuang1111,项目名称:Bird,代码行数:5,
示例12: CC_RECT_POINTS_TO_PIXELSvoid CC3DSprite::updateTextureCoords(CCRect rect, bool rotated){ rect = CC_RECT_POINTS_TO_PIXELS(rect); CCTexture2D *tex = m_pobTexture; if (! tex) { return; } float atlasWidth = (float)tex->getPixelsWide(); float atlasHeight = (float)tex->getPixelsHigh(); float left, right, top, bottom; if (rotated) {#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); right = left+(rect.size.height*2-2)/(2*atlasWidth); top = (2*rect.origin.y+1)/(2*atlasHeight); bottom = top+(rect.size.width*2-2)/(2*atlasHeight);#else left = rect.origin.x/atlasWidth; right = (rect.origin.x+rect.size.height) / atlasWidth; top = rect.origin.y/atlasHeight; bottom = (rect.origin.y+rect.size.width) / atlasHeight;#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL /* if (m_bFlipX) { CC_SWAP(top, bottom, float); } if (m_bFlipY) { CC_SWAP(left, right, float); }*/ m_sQuad.bl.texCoords.u = left; m_sQuad.bl.texCoords.v = top; m_sQuad.br.texCoords.u = left; m_sQuad.br.texCoords.v = bottom; m_sQuad.tl.texCoords.u = right; m_sQuad.tl.texCoords.v = top; m_sQuad.tr.texCoords.u = right; m_sQuad.tr.texCoords.v = bottom; } else {#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL left = (2*rect.origin.x+1)/(2*atlasWidth); right = left + (rect.size.width*2-2)/(2*atlasWidth); top = (2*rect.origin.y+1)/(2*atlasHeight); bottom = top + (rect.size.height*2-2)/(2*atlasHeight);#else left = rect.origin.x/atlasWidth; right = (rect.origin.x + rect.size.width) / atlasWidth; top = rect.origin.y/atlasHeight; bottom = (rect.origin.y + rect.size.height) / atlasHeight;#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL /*if(m_bFlipX) { CC_SWAP(left,right,float); } if(m_bFlipY) { CC_SWAP(top,bottom,float); }*/ m_sQuad.bl.texCoords.u = left; m_sQuad.bl.texCoords.v = bottom; m_sQuad.br.texCoords.u = right; m_sQuad.br.texCoords.v = bottom; m_sQuad.tl.texCoords.u = left; m_sQuad.tl.texCoords.v = top; m_sQuad.tr.texCoords.u = right; m_sQuad.tr.texCoords.v = top; }}
开发者ID:ElmerNing,项目名称:Cocos2d-x-ParticleEditor-for-Windows,代码行数:82,
示例13: CC_RECT_POINTS_TO_PIXELSvoid CCSprite::setTextureRect(CGRect rect){ CGRect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); setTextureRectInPixels(rectInPixels, false, rectInPixels.size);}
开发者ID:valentinvit,项目名称:cocos2d-x,代码行数:5,
示例14: initvoid VBModel::InitWithLibName(VBObjectFile2D* _obj2D, CCTexture2D* _texture, VBObjectFile2DLibraryNameID* _library_name_id, bool _is_realtime_animation, ccBlendFunc _blend) { init(); use_mix_color = true; is_use_animation = true; is_play_loop = true; is_play = true; is_real_time_animation = _is_realtime_animation; frame_rate = VBObjectFile2DGetFrameRate(_obj2D); VBObjectFile2DLibrary* _library = VBObjectFile2DGetLibraryByNameID(_obj2D, _library_name_id); void* _library_base = VBObjectFile2DLibraryGetBase(_library); if(VBObjectFile2DLibraryType_Bitmap == VBObjectFile2DLibraryGetType(_library)) { is_bitmap = true; VBObjectFile2DLibraryBitmap* _bitmap = (VBObjectFile2DLibraryBitmap*)_library_base; VBULong _poly_len = VBObjectFile2DLibraryBitmapGetUVInfoLength(_bitmap); VBVector2D _txc[_poly_len]; VBVector2D* _uv = VBObjectFile2DLibraryBitmapGetUVInfo(_bitmap); VBVector2D* _txc_ptr = _txc; for(int _i = 0; _i < _poly_len; _i++) { _txc_ptr->x = _uv[_i].x; _txc_ptr->y = _uv[_i].y; _txc_ptr++; } setTexture(_texture); CCRect _rect = CCRect(_txc[0].x * _texture->getPixelsWide(), _txc[0].y * _texture->getPixelsHigh(), (_txc[2].x * _texture->getPixelsWide() - _txc[0].x * _texture->getPixelsWide()), (_txc[2].y * _texture->getPixelsHigh() - _txc[0].y * _texture->getPixelsHigh())); cocos2d::CCSprite::setTextureRect(CC_RECT_POINTS_TO_PIXELS(_rect));// cocos2d::CCSprite::setTextureRect(CCRect(_txc[0].x * _texture->getPixelsWide() / CCDirector::sharedDirector()->getContentScaleFactor(),// _txc[0].y * _texture->getPixelsHigh() / CCDirector::sharedDirector()->getContentScaleFactor(),// (_txc[2].x * _texture->getPixelsWide() - _txc[0].x * _texture->getPixelsWide()) / CCDirector::sharedDirector()->getContentScaleFactor(),// (_txc[2].y * _texture->getPixelsHigh() - _txc[0].y * _texture->getPixelsHigh()) / CCDirector::sharedDirector()->getContentScaleFactor())// ); } else if(VBObjectFile2DLibraryType_Graphic == VBObjectFile2DLibraryGetType(_library) || VBObjectFile2DLibraryType_MovieClip == VBObjectFile2DLibraryGetType(_library)) { frame_all_allocated_child_models = VBArrayVectorInit(VBArrayVectorAlloc()); frame_willFree_child_models = VBArrayVectorInit(VBArrayVectorAlloc()); frame_current_key_frame = VBArrayVectorInit(VBArrayVectorAlloc()); if(VBObjectFile2DLibraryType_Graphic == VBObjectFile2DLibraryGetType(_library)) { VBObjectFile2DLibraryGraphic* _graphic = (VBObjectFile2DLibraryGraphic*)_library_base; frame = VBObjectFile2DLibraryGraphicGetFrame(_graphic); } else if(VBObjectFile2DLibraryType_MovieClip == VBObjectFile2DLibraryGetType(_library)) { VBObjectFile2DLibraryMovieClip* _movie_clip = (VBObjectFile2DLibraryMovieClip*)_library_base; frame = VBObjectFile2DLibraryMovieClipGetFrame(_movie_clip); } is_play = VBTrue; is_play_loop = VBTrue; is_animation_update = VBTrue; while (frame_all_allocated_child_models->len < frame->key_frame->len) { VBArrayVectorAddBack(frame_all_allocated_child_models, NULL); } for(int i = 0; i < frame->key_frame->len; i++) { VBObjectFile2DKeyFrame* _key_frame = (VBObjectFile2DKeyFrame*)frame->key_frame->data[i]; if(frame_all_allocated_child_models->data[i] == NULL) { VBModel* _child = new VBModel(_obj2D, _texture, _key_frame->library_id, _is_realtime_animation, _blend); frame_all_allocated_child_models->data[i] = _child; VBArrayVectorAddBack(frame_willFree_child_models, _child); LinkChildKeyFrames(i, _child, _key_frame); } } } Update(0.0f); setBlendFunc(_blend);}
开发者ID:devmario,项目名称:VBEngine-cocos2dx,代码行数:75,
示例15: CC_RECT_POINTS_TO_PIXELSbool SpriteFrame::initWithTextureFilename(const char* filename, const Rect& rect){ Rect rectInPixels = CC_RECT_POINTS_TO_PIXELS( rect ); return initWithTextureFilename(filename, rectInPixels, false, Point::ZERO, rectInPixels.size);}
开发者ID:ADoby,项目名称:Project_Space_Pirate,代码行数:5,
示例16: CC_RECT_POINTS_TO_PIXELSbool CCSpriteFrame::initWithTexture(CCTexture2D* pobTexture, CCRect rect){ CCRect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect); return initWithTexture(pobTexture, rectInPixels, false, CCPointZero, rectInPixels.size);}
开发者ID:MySure,项目名称:Test,代码行数:5,
注:本文中的CC_RECT_POINTS_TO_PIXELS函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CC_RETURN_IF函数代码示例 C++ CC_RECT_PIXELS_TO_POINTS函数代码示例 |