본문 바로가기

전체 글

(1789)
터치 이벤트 처리 방법 터치 이벤트를 이용해 화면을 이동해 보고, 다양한 터치 이벤트를 어떻게 사용하는지 실습해 보겠습니다. // // GameScene.h // GameDemo // // Created by cmpak on 5/11/10. // Copyright 2010 thefirstgood.com. All rights reserved. // #import "cocos2d.h" @class GameLayer; @interface GameScene : CCScene { GameLayer *gameLayer; } @end // // GameScene.m // GameDemo // // Created by cmpak on 5/11/10. // Copyright 2010 thefirstgood.com. All rights rese..
디바이스 화면보다 큰 배경 스크롤하기 아이폰 가로 화면의 픽셀 크기는 480x320 입니다. (아이폰4 이전 버전) 화면의 가로 크기보다 훨씬 큰 배경 이미지를 스크롤 할 수 있게 해 보겠습니다. 여기서는 CCSprite와 CCParallaxNode를 사용합니다. 작업할 파일은 다음과 같습니다. (1) GameScene.h (2) GameScene.m (3) GameDemo_Delegate.m GameScene.h // // GameScene.h // GameDemo_BGScroll // // Created by cmpak on 5/10/10. // Copyright 2010 thefirstgood.com. All rights reserved. // //#import #import "cocos2d.h" //@interface GameScen..
Scene과 Menu 만들기 작업할 파일을 다음과 같습니다. (1) MenuScene.h (2) MenuScene.m (3) GameDemoAppDelegate.m MenuScene.h // // MenuScene.h // GameDemo // // Created by cmpak on 5/7/10. // Copyright 2010 thefirstgood.com. All rights reserved. // //#import #import "cocos2d.h" //@interface MenuScene : NSObject { @interface MenuScene : CCScene { } @end MenuScene.m // // MenuScene.m // GameDemo // // Created by cmpak on 5/7/10. // C..
MKMapView 1. MapKit.framework 등록합니다. 2. #import #import @interface ImgGPSViewController : UIViewController { IBOutlet MKMapView *mapView; } @property (nonatomic, retain) MKMapView *mapView; @end 3. @synthesize mapView; // 위도, 경도 CLLocationCoordinate2D mapCenter; mapCenter.latitude = doubleValue; mapCenter.longitude = doubleValue; // 여기에 위도와 경로 값을 넣는다. // 지도의 기본 크기 MKCoordinateSpan mapSpan; mapSpan.latitud..
MKMapView에 MKAnnotation 사용하기 1. MapKit.framework 라이브러리를 추가한다. 2. #import #import @interface Annotation : NSObject { double dLatitude; double dLongitude; NSString *sTitle; NSString *sSubtitle; } @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; - (id)initWithLatitude:(double)latitude longitude:(double)longitude title:(NSString*)title subtitle:(NSString*)subtitle; - (NSString *)title; - (NSString *)subtitle; ..
iphone-exif 라이브러리 파일 보호되어 있는 글입니다.
JPEG 메타데이터 얻기 (iphone-exif 라이브러리 사용) 1. indlude.zip 파일 안에는 EXIF 관련 .m .h 파일이 들어있습니다. include.zip 파일의 압축을 풀어서 프로젝트 안에 추가 시킵니다. 2. AppDelegate.m 내부에 BOOL gLogging = FALSE; 을 적어줘야 합니다. 3. EXIF를 사용할 페이지 위에 #import "EXF.h" 를 선언해 줍니다. 4. 이미지 파일을 불러와서 메타데이터를 추출 후 위도와 경도를 가져옵니다. NSString * path = [[NSBundle mainBundle]pathForResource:@"IMG_0902" ofType:@"JPG"]; NSMutableData *imageData = [NSMutableData dataWithContentsOfFile:path]; EXFJpeg..
아이폰 GPS 사용하기 ♨ 프레임워크 추가 : CoreLocation.framework #import #import @interface LocationServiceViewController : UIViewController { CLLocationManager *locationManager; IBOutlet UILabel *latitude; IBOutlet UILabel *longitude; IBOutlet UILabel *Heading; } @property (nonatomic, retain) CLLocationManager *locationManager; @property (nonatomic, retain) IBOutlet UILabel *latitude; @property (nonatomic, retain) IBOutlet..