Created
January 19, 2013 00:02
-
-
Save LearnCocos2D/4569727 to your computer and use it in GitHub Desktop.
Initializer object demo. Instead of initializers with dozens of variants of "initWith…" methods, KoboldTouch makes heavy use of initializer object. These are simple Objective-C classes consisting mainly of properties. They set sensible defaults so you only need to change the properties that have to be set, and those you want to change. Then init…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set menu options with the initializer object | |
KTTextMenu* textMenu = [KTTextMenu menuWithTextMenuItems:[NSArray arrayWithObjects:item1, item2, nil]]; | |
textMenu.fontName = @"Arial"; | |
textMenu.fontSize = 48; | |
textMenu.padding = 16; | |
// init the menu with the initializer object | |
KTMenuViewController* menuViewController = [KTMenuViewController menuControllerWithTextMenu:textMenu]; | |
[self addSubController:menuViewController]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment