読者です 読者をやめる 読者になる 読者になる

letsspeak's diary

世界を大いに盛り上げるためのletsspeakの日記。

シンタックスハイライトをXcodeっぽくしてみた

カスタムCSSデザイン設定

.synComment { color:#3e9910 }
.synConstant { color:#cc0000 }
.synIdentifier { color:#454545 }
.synPreProc { color:#7f3f11 }
.synSpecial { color:#c000c0 }
.synStatement { color:#cc16ad }
.synType { color:#cc16ad }

結果

#import "CCLayer.h"
#import "SRPG.h"
#import "SRArea.h"

@interface SRAreaLayer : CCLayer

- (void)removeAllAreaSprite;
- (void)drawArea:(SRArea*)area;

@end

// on "init" you need to initialize your instance
-(id) init
{
	// always call "super" init
	// Apple recommends to re-assign "self" with the "super" return value
	if( (self=[super init])) {
        
        // create map layer
        _mapLayer = [SRMapLayer node];
        [self addChild:_mapLayer];
        
        // create area layer
        _areaLayer = [SRAreaLayer node];
        [self addChild:_areaLayer];
        
        // create units
        self.unitArray = [CCArray array];
        
        SRUnit *unit1 = [[SRUnit alloc] init];
        unit1.spriteFilename = @"pc01_00.png";
        unit1.fieldPoint = SRFieldPointMake(5, 5);
        unit1.moving = 3;
        [self.unitArray addObject:unit1];
        
        SRUnit *unit2 = [[SRUnit alloc] init];
        unit2.spriteFilename = @"pc01_00.png";
        unit2.fieldPoint = SRFieldPointMake(2, 10);
        unit2.moving = 5;
        [self.unitArray addObject:unit2];
        
        // create unit layer and set units
        _unitLayer = [SRUnitLayer node];
        [_unitLayer setUnits:_unitArray];
        [self addChild:_unitLayer];
        
        self.selectedUnit = nil;
        self.phase = SRFieldScenePhaseNoAction;

	}
	return self;
}