Game Development Reference
In-Depth Information
[[CCDirector sharedDirector] replaceScene:[MyGameLayer nodeWithScene]];
The HelloWorldLayer interface declaration is pretty unspectacular and provides
only three instance variables that will later be loaded from the config.lua file:
#import "cocos2d.h"
@interface HelloWorldLayer : CCLayer
{
NSString* helloWorldString;
NSString* helloWorldFontName;
int helloWorldFontSize;
}
@property (nonatomic, copy) NSString* helloWorldString;
@property (nonatomic, copy) NSString* helloWorldFontName;
@property (nonatomic) int helloWorldFontSize;
@end
At this point, you should take note of a particular addition to the config.lua file.
There's an additional Lua table labeled HelloWorldSettings in Listing 16-2,
which provides three familiar-looking settings: HelloWorldString , Hel-
loWorldFontName , and HelloWorldFontSize .
Listing 16-2 . Custom config.lua Settings
local config =
{
KKStartupConfig =
{
-- start-up settings removed for brevity
},
HelloWorldSettings =
 
 
Search Nedrilad ::




Custom Search