iphone Programming Glossary: spritewithfile
How to approach -hd files http://stackoverflow.com/questions/10232539/how-to-approach-hd-files Apple recommends to re assign self with the super return value if self super init CCSprite parallaxLayer01 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer02 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer03 CCSprite spriteWithFile.. if self super init CCSprite parallaxLayer01 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer02 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer03 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer04 CCSprite spriteWithFile.. @ 0 hd red.png CCSprite parallaxLayer02 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer03 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer04 CCSprite spriteWithFile @ 0 hd red.png CCSprite parallaxLayer01 CCSprite spriteWithFile..
Cocos2d adding a background image to a layer? http://stackoverflow.com/questions/1954936/cocos2d-adding-a-background-image-to-a-layer and as far as I understand to add a background image to a layer you have to do something like Sprite bg Sprite spriteWithFile @ Background.png layer addChild bg z 0 Allthough as far as my testing goes you can just directly add the sprite to the scene.. add the sprite to the scene like this @implementation IntroScene id init self super init if self nil Sprite bg Sprite spriteWithFile @ Background.png bg setPosition ccp 240 160 self addChild bg z 0 self addChild MenuLayer node z 1 return self What is the..
Cocos2d CCSprite Class get the name of the image file http://stackoverflow.com/questions/3653986/cocos2d-ccsprite-class-get-the-name-of-the-image-file using the following code NSString fileName imagesPath objectAtIndex i lastPathComponent CCSprite sprite CCSprite spriteWithFile fileName Now is there anyway to later find out the name of the image file used for the particular CCSprite object UPDATE..
Random Sprite Destinations http://stackoverflow.com/questions/3817637/random-sprite-destinations self addChild sheet CCSpriteFrameCache sharedSpriteFrameCache addSpriteFramesWithFile @ metImg.plist target CCSprite spriteWithFile @ Frame2.png rect CGRectMake 0 0 60 120 CGSize winSize CCDirector sharedDirector winSize int minY target.contentSize.height.. main meat of the code nothing else could impact the position of the targets. void addTarget CCSprite target CCSprite spriteWithFile @ dude_jump.png rect CGRectMake 0 0 30 60 CGSize winSize CCDirector sharedDirector winSize int minY target.contentSize.width..
Repeating background in cocos2d has black edges! http://stackoverflow.com/questions/6736759/repeating-background-in-cocos2d-has-black-edges is exactly 200x200. Here is a screenshot of how it looks along with the code if self super init CCSprite bg CCSprite spriteWithFile @ pattern11.jpg rect CGRectMake 0 0 1000 520 bg setPosition ccp 0 0 ccTexParams params GL_LINEAR GL_LINEAR GL_REPEAT GL_REPEAT..
|