@@ -269,29 +269,35 @@ -(void)setupSimpleLightingTest
269269 light.depth = lightDepth;
270270
271271 CCSprite *lightSprite = [CCSprite spriteWithImageNamed: @" Images/snow.png" ];
272- [light addChild: lightSprite];
273272
274273 CCEffectLighting *lightingEffect = [[CCEffectLighting alloc ] initWithLights: @[light]];
275274 lightingEffect.shininess = 10 .0f ;
276275
277276 CCSprite *sprite = [CCSprite spriteWithImageNamed: diffuseImage];
278277 sprite.positionType = CCPositionTypeNormalized;
279- sprite.position = position ;
278+ sprite.position = ccp ( 0 . 5f , 0 . 5f ) ;
280279 sprite.normalMapSpriteFrame = [CCSpriteFrame frameWithImageNamed: normalMapImage];
281280 sprite.effect = lightingEffect;
282281 sprite.scale = 0 .5f ;
283282
284- [self .contentNode addChild: sprite];
285-
286- [sprite addChild: light];
287-
288- CCLabelTTF *label = [CCLabelTTF labelWithString: title fontName: @" HelveticaNeue-Light" fontSize: 18 * [CCDirector sharedDirector ].UIScaleFactor];
283+ CCNode *root = [[CCNode alloc ] init ];
284+ root.positionType = CCPositionTypeNormalized;
285+ root.position = position;
286+ root.anchorPoint = ccp (0 .5f , 0 .5f );
287+ root.contentSizeType = CCSizeTypePoints;
288+ root.contentSize = CGSizeMake (200 .0f , 200 .0f );
289+
290+ CCLabelTTF *label = [CCLabelTTF labelWithString: title fontName: @" HelveticaNeue-Light" fontSize: 12 * [CCDirector sharedDirector ].UIScaleFactor];
289291 label.color = [CCColor whiteColor ];
290292 label.positionType = CCPositionTypeNormalized;
291- label.position = ccp (0 .5f , 1 .1f );
293+ label.position = ccp (0 .5f , 1 .0f );
292294 label.horizontalAlignment = CCTextAlignmentCenter;
293295
294- [sprite addChild: label];
296+ [self .contentNode addChild: root];
297+ [root addChild: label];
298+ [root addChild: sprite];
299+ [root addChild: light];
300+ [light addChild: lightSprite];
295301
296302 [light runAction: [CCActionRepeatForever actionWithAction: [CCActionSequence actions:
297303 [CCActionMoveTo actionWithDuration: 1.0 position: ccp (1 .0f , 1 .0f )],
0 commit comments