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
/*! | |
Return the -boundingBox of another node, converted into this node's local | |
coordinate space. | |
*/ | |
-(CGRect) boundingBoxConvertedToNodeSpace:(CCNode *)other | |
{ | |
// Get the bottomLeft and topRight corners of the other node's bounding box | |
// in the other node's coordinate space. | |
CGRect boundingBox = [other boundingBox]; | |
CGPoint bottomLeft = CGPointMake(boundingBox.origin.x, boundingBox.origin.y); |
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
#!/usr/bin/env python | |
u""" | |
Upscales a Tiled TMX map for use with a retina display. | |
Fixes tile size, object position and size, image size. | |
Saves the retina file as filename-hd.tmx in the same folder as the source file. | |
""" |
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
// | |
// GFFParallaxNode.h | |
// | |
// Created by Rolando Abarca on 12/14/09. | |
// | |
#import <Foundation/Foundation.h> | |
#import "cocos2d.h" | |
#define MAX_PARALLAX_CHILDREN 25 |
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
// | |
// CCSpriteFrameCache_SWF.h | |
// CCSpriteFrameCache_SWF_Extension | |
// | |
// Created by Salvatore Gionfriddo on 11/28/11. | |
// Copyright (c) 2011 Taco Graveyard. All rights reserved. | |
// | |
#include <vg/openvg.h> | |
#include <vg/vgu.h> |
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
#import <Foundation/Foundation.h> | |
#import "cocos2d.h" | |
@interface CCSpriteFrameCache (SWF) | |
-(void) addSpriteFramesWithSWF:(NSString*)filename; | |
@end |
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
-(void)addGesture | |
{ | |
//: 드래그 | |
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePanGesture:)]; | |
pan.minimumNumberOfTouches = 1; | |
pan.maximumNumberOfTouches = 1; | |
[someView addGestureRecognizer:pan]; | |
//: 핀치 | |
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)]; |
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
// | |
// Lightning.h | |
// Trundle | |
// | |
// Created by Robert Blackwood on 12/1/09. | |
// Copyright 2009 Mobile Bros. All rights reserved. | |
// | |
#import "cocos2d.h" |
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
#import <Foundation/Foundation.h> | |
#import "cocos2d.h" | |
@interface TGScoreLabel : CCLabelTTF { | |
double curScore_; // the current score value of the label | |
BOOL updating_; // if we currently have an update running | |
double interval_; // how long we wait between updates | |
int score; // the target score | |
NSString * formatString; // the string that we format |
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
#include <OpenGL/OpenGL.h> | |
#include <GLUT/GLUT.h> | |
int main(int argc, const char * argv[]) | |
{ | |
glutInit(&argc, const_cast<char **>(argv)); | |
return 0; | |
} |
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
#include <OpenGL/OpenGL.h> | |
#include <GLUT/GLUT.h> | |
void renderScene(void) | |
{ | |
glClear(GL_COLOR_BUFFER_BIT); | |
glFlush(); | |
} |