This file contains hidden or 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
| -(void) initializeDirector | |
| { | |
| // before creating any layer, set the landscape mode | |
| // Initialize Director | |
| [[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; | |
| [[Director sharedDirector] setAnimationInterval:1.0/60]; | |
| [[Director sharedDirector] setDisplayFPS:YES]; | |
| // create an openGL view inside a window |
This file contains hidden or 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
| -(void) initializeDirectorWithScene:(Scene *) scene | |
| { | |
| // before creating any layer, set the landscape mode | |
| // Initialize Director | |
| [[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft]; | |
| [[Director sharedDirector] setAnimationInterval:1.0/60]; | |
| [[Director sharedDirector] setDisplayFPS:YES]; | |
| // create an openGL view inside a window | |
| [[Director sharedDirector] attachInView:window]; |
This file contains hidden or 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
| // Init the window | |
| window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
| // cocos2d will inherit these values | |
| [window setUserInteractionEnabled:YES]; | |
| [window setMultipleTouchEnabled:YES]; | |
| // must be called before any othe call to the director | |
| // WARNING: FastDirector doesn't interact well with UIKit controls | |
| // [Director useFastDirector]; |
This file contains hidden or 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
| require 'nokogiri' | |
| system 'unzip Alliance.docx' | |
| doc = Nokogiri::XML(open('word/document.xml')) | |
| # Using Label Tag | |
| doc.xpath("//w:fldSimple[contains(@w:instr, 'label_tag')]").each do |link| | |
| command = link.attributes["instr"].value.match(/\#\{(.*)\}/)[1] | |
| replacement_string = eval(command) | |
| element.replace(Nokogiri::XML::Text.new(replacement_string, doc)) |
NewerOlder