Keys的博客
Keys · 共 6 篇文章
添加角色动画关键点
CCSpriteBatchNode *spriteBatchNode; //use the textureAtlas and class CCSpriteBatchNode //ipad device if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"atlas.plist"]; spriteBatchNode = [CCSpriteBatchNode batchNodeWithFi…
2012-07-11 17:58 · cocos2d · 评论(0)
Top Reasons to Use a Texture Atlas/Sprite Sheet
Reduced OpenGL ES bind calls—the more images contained in the textureatlas, the greater the reduction. Reduced memory footprint for the images stored as textures in memory. Easy method to trim and save on transparent space in your images, allowing formore images/texture in the same space. Zwoptex a…
2012-07-11 17:55 · cocos2d · 评论(0)
slider
/*获取slider值 events:ValueChanged * *@property (strong, nonatomic) IBOutlet UILabel *numberSlider; * */ - (IBAction)sliderChanger:(id)sender { UISlider *slider = (UISlider *)sender; int value = (int)roundf(slider.value); numberSlider.text = [NSString stringWithFormat:@"%d",value]; }
2012-07-11 17:19 · iOS 控件 · 评论(0)
Control States description
Control States Every iOS control has four possible control states and is always in one, and only one, of these states at any given moment: Normal: The most common state is the normal control state, which is the default state. It’s the state that controls are in when not in any of the other states. …
按钮选中后变换按钮背景图
在- (void)viewDidLoad 中: UIImage *buttonImageNormal = ; UIImage *stretchableImage = stretchableImageWithLeftCapWidth :12 topCapHeight:0]; UIControlStateNormal ]; UIImage *buttonImagePressed = ; UIImage *stretchablePressed = ; UIControlStateHighlighted ];
Object-C学习笔记 基础部分(一)NSString常用方法
个人学习笔记 NSString --实例化方法-------------- NSString *str = init]; NSString *str = init] autorelease]; 注意:在NSString 中存在自己的实例化和初始化的方法 例如: NSString *str1 = ; NSString *str2 = initWithCString:"new String" enconding: NSACIIStringEncoding]; str1和str2两个对象是相同的。 --NSStringEncoding 中常用的字符编码---------------- NSASCI…
2011-07-06 17:19 · Object-C · 评论(0)