ITeye博客

2012 年文章归档

共 5 篇文章

添加角色动画关键点

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

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

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 控件

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. …

2012-07-11 17:12 · Object-C · iOS

按钮选中后变换按钮背景图

在- (void)viewDidLoad 中: UIImage *buttonImageNormal = ; UIImage *stretchableImage = stretchableImageWithLeftCapWidth :12 topCapHeight:0]; UIControlStateNormal ]; UIImage *buttonImagePressed = ; UIImage *stretchablePressed = ; UIControlStateHighlighted ];

2012-07-11 17:06 · Object-C · iOS