cocos2d - Changing the image of a CCSprite
2013-12-05 16:47
274 查看
CCTexture2D* tex = [[CCTextureCache sharedTextureCache] addImage:@"new_image_name"]; [spriteWant2Change setTexture: tex];
what to do if texture is different in size from previous one ?
If the sprites are of different size then you will need to do this after calling setTexture function
[spriteWant2Change setTextureRect:CGRectMake(0, 0, tex.contentSize.width, tex.contentSize.height)];
摘自:Stack Overflow
相关文章推荐
- Changing the contrast and brightness of an image!
- Changing The Size Of An Image
- Zero-shot learning on the ImageNet of over 20000 classes
- Changing the description of the standard SAP fields
- Changing the Title of SAP Transaction
- IB纪录:At the heard of the image
- Changing the working directory of VIM
- IB纪录(二十三):At the heard of the image
- #316 – 改变按钮的ClickMode(Changing the ClickMode of a Button)
- 14.4.2 Changing the Number or Size of InnoDB Redo Log Files 改变 InnoDB Redo Log Fiels 的大小和数量
- The Importance of Skip Connections in Biomedical Image segmentation_2016
- Adding two image & changing the contrast and blightness & Basic Drawing
- 【论文笔记】Active Convolution: Learning the Shape of Convolution for Image Classification
- 数字图像处理实验(2):PROJECT 02-02, Reducing the Number of Gray Levels in an Image
- iOS开发中的错误整理,Changing the delegate of a tab bar managed by a tab bar controller is not allowed
- IB纪录(二):At the heart of the image
- The changing marketplace of bioinformatics
- Changing the name of your SQL Server
- 各种图像处理类库的比较及选择(The Comparison of Image Processing Libraries)
- CHANGING BEHAVIOR BASED ON THE VALUE OF AN ENUMERATED TYPE(ZT)