태그 : Cocos2d
2010/03/01 Cocos2D에서 통짜 Sprite화일 쉽게 사용하는 법 [3]

@interface UIWindowShake : UIWindow
{
}
@end
@interface MyAppDelegate : NSObject <UIApplicationDelegate> {
UIWindowShake * window;
...
}
@property (nonatomic, retain) UIWindowShake* window;
...
@implementation UIWindowShake
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (motion == UIEventSubtypeMotionShake) {
NSLog(@"Shake!");
// 흔들기 처리~
}
}
@end
@implementation MyAppDelegate
- (void) applicationDidFinishLaunching:(UIApplication*)application
{
...
//------------------------------------------------
// Init the window
CGRect bound = [[UIScreen mainScreen] bounds];
window = [[UIWindowShake alloc] initWithFrame:bound];
...
}
...
@end
# by | 2010/09/26 00:45 | 개발 | 트랙백 | 덧글(0)

# by | 2010/03/01 00:05 | 개발 | 트랙백 | 덧글(3)
◀ 이전 페이지 다음 페이지 ▶