'잡다한것들전부/팁'에 해당되는 글 38건

  1. 2014.07.30 공부하고 싶은 것들 정리.(구글킵)
  2. 2014.01.16 [디버깅] Cocos2dx 이클립에서 안드로이드 네이티브 디버깅
  3. 2014.01.14 cocos2d-x 멀티 터치 처리하기
  4. 2014.01.13 autoRelease 및 retain() , release(), retainCount()
  5. 2014.01.13 CCNode 및 CCArray 의 메모리 관리
  6. 2014.01.13 cocos2d-x multi-resolution
  7. 2014.01.13 cocos2d-x 스크롤 테이블뷰 예제 소스
  8. 2014.01.13 cocos2d-x CCString 분리후 CCArray 에 넣기( 문자열 분리하기)
  9. 2014.01.13 cocos2d-x 의 메모리 관리
  10. 2014.01.13 cocos2d-x 멀티해상도 지원

공부하고 싶은 것들 정리.(구글킵)

|

공부방향


이펙티브 시리즈나
혹은 해골,용책 정도 밖에 생각이 나질 않아서요
물리책도 보고, AI책도 보고 그러는거죠.
리펙토링도 해보고 설계도 해보세요.
공룡책 한번 보세요. OS 에 관한책입니다.
국어, 수학, 물리, 영어
디자인패턴이나 리팩토링 Code Complete 뭐 이런 류의 책

C++(1학년): try-catch,template,다형성
데이터구조론(2학년): tree, hash, sort
데이터베이스(3학년): 제2정규화, stored procedure
운영체제론(3학년): Operating System Concepts (이른바 공룡책)의 "프로세스" 챕터
컴퓨터네트워크(3학년): OSI 3-4 level, ARQ 알고리즘
컴파일러(4학년): BNF grammar
정보보호(4학년): RSA, AES, DES

http://www.hanmadiro.com/ -무료영어
http://www.ebsi.co.kr/ebs/pot/potg/retrieveCourseH3TeacherInfo.ebs?teacherId=@*ebsint_e68&targetCode=D200
영어
http://www.ebsi.co.kr/ebs/pot/potg/retrieveCourseH3TeacherInfo.ebs?teacherId=@*09st-m02&targetCode=D300
수학

1. Direct 3D 엔진 개발을 위한 루트로, 고 기술력이 요구되는 방향의 진로
2. 게임 브리오, 언리얼등 유명 게임 엔진 유경험을 쌓아 보편적인 3D 게임 개발자로의 진로

MS SQL은
뇌를 자극하는 SQL Server 2008 - 한빛미디어






c++ 서적


- c++ 기초 플러스
- effetive c++





c# 스프라이트 툴 만들기


http://cafe.naver.com/jzsdn/25183






게임샐러드 관련 강좌


http://diyga.me/
http://blog.naver.com/hellofskill
게임샐러드책은 국내에 한권뿐

Trackback 0 And Comment 0

[디버깅] Cocos2dx 이클립에서 안드로이드 네이티브 디버깅

|







Android.mk
include $(BUILD_SHARED_LIBRARY)$(call import-add-path,/full/path/to/cocos2d-x/)$(call import-add-path,/full/path/to/cocos2d-x/cocos2dx/platform/third_party/android/prebuilt)$(call import-module,cocos2dx)

C/C++ Build -> Build Command
bash ${ProjDirPath}/build_native.sh NDK_DEBUG=1 V=1


Trackback 0 And Comment 0

cocos2d-x 멀티 터치 처리하기

|


void HelloWorld::ccTouchesEnded( CCSet * touches, CCEvent * event )

{

//멀티터치 처리

CCSetIterator it = touches->begin();

CCTouch* touch;

for( int iTouchCount = 0; iTouchCount < touches->count(); iTouchCount++ )

{

touch = (CCTouch*)(*it);

CCPoint location = touch->getLocationInView();

location = CCDirector::sharedDirector()->convertToGL(location);

it++;

}

}

Trackback 0 And Comment 0

autoRelease 및 retain() , release(), retainCount()

|

Cocos2d-x의 메모리 관리

Reference Count

레퍼런스카운터는 c와 c++의 메모리관리의 오래된 방법이다. ios에서는 8년전부터 이 메커니즘을 써왔다.
cocos2d-x에서도 ios ndk 의 NSAutoreleasePool와 거의 같은 CCAutoreleasePool이 존재한다 . 사용방법은 거의 동일하며 만약 너가 ios로 개발한 경험이 없으면 NSAutoreleasePool class Reference를 읽어봐라 


CCAutoreleasePool

CCAutoreleasePool 은 NSAutoreleasePool거의 같지만 2개의 차이점이있?다.

  1. CCAutoreleasePool 은NESTED에서 사용할수없다. 오직 게임 인스턴스에서만 사용 가능하다.
  2. CCAutoreleasePool 은 멀티쓰레드에서 사용할수 없다. 

CCAutoreleasePool의 로직은 간단하다 만약 너가l object->autorelease()을 실행하면 object는  autorelease pool 에 들어가게 된다. 

autorelease pool은 루프가 끝날시 자동으로 release()이 되게 도와준다. 

예를들어 layer->addChild(sprite), 이 sprite 는 레이어의 차일드이다, 이것은 레이어가 release될때까지 pool에서 유지된다


CCObject::release(), retain() and autorelease()

->release() 가 필요할때
1. "new" 연산자를 사용할때  CCSprite,CCLayer 등(CCObject를 상속받는 자식들)
2. "retain()"을 호출할때


release나 retain이 필요없는 예제:

CCSprite* sprite = CCSprite::spriteWithFile("player.png");


위 예제는 autorelease()풀에 의해서 관리되기때문에  release나 retain이 필요없다.


An Error Sample

bool HelloWorld::init()
{
    bool bRet = false;
    do
    {
        //////////////////////////////////////////////////////////////////////////
        // super init first
        //////////////////////////////////////////////////////////////////////////

        CC_BREAK_IF(! CCLayer::init());

        //////////////////////////////////////////////////////////////////////////
        // add your codes below...
        //////////////////////////////////////////////////////////////////////////

                CCSprite* bomb1 = CCSprite::spriteWithFile("CloseNormal.png");
                CCSprite* bomb2 = CCSprite::spriteWithFile("CloseNormal.png");
                CCSprite* bomb3 = CCSprite::spriteWithFile("CloseNormal.png");
                CCSprite* bomb4 = CCSprite::spriteWithFile("CloseNormal.png");
                CCSprite* bomb5 = CCSprite::spriteWithFile("CloseNormal.png");
                CCSprite* bomb6 = CCSprite::spriteWithFile("CloseNormal.png");

                addChild(bomb1,1);
                addChild(bomb2,1);
                addChild(bomb3,1);
                addChild(bomb4,1);
                addChild(bomb5,1);
                addChild(bomb6,1);

                m_pBombsDisplayed = CCMutableArray<CCSprite*>::arrayWithObjects(bomb1,bomb2,bomb3,bomb4,bomb5,bomb6,NULL);
                //m_pBombsDisplayed is defined in the header as a protected var.
                // <--- We should add m_pBombsDisplayed->retain() here to avoid crashing in HelloWorld::refreshData()

                this-]]>scheduleUpdate();
        bRet = true;
    } while (0);

    return bRet;
}

void HelloWorld::update(ccTime dt)
{
        refreshData();
}

void HelloWorld::refreshData()
{
        CCMutableArray<CCSprite*]]>::CCMutableArrayIterator iter = m_pBombsDisplayed-]]>begin();
        (*iter)-]]>setPosition(ccp(100,100));
}

이 예제의 실수는 m_pBombsDisplayed 는 CCMutalbeArray<CCSprite*>::arrayWithObjects 에 의해 생성되는데, autoRelease()에의해 관리되기때문에

루프가 지나면 사라진다. 
이문제를 해결하기 위해서는  m_pBombsDisplayed = CCMutableArray<CCSprite*]]>::arrayWithObjects(...); 뒤에 m_pBombsDisplayed->retain()를 추가하고, HelloWorld::~HelloWorld() 소멸자에서 m_pBombsDisplayed->release()한다.

Trackback 0 And Comment 0

CCNode 및 CCArray 의 메모리 관리

|
CCArray의 소멸자에서 CCArray에 들어있는 모든 CCObject형을 전부 삭제해주고 메모리 해제를 해준다.

CCArray::~CCArray()
{
    ccArrayFree(data);
}

/** Frees array after removing all remaining objects. Silently ignores NULL arr. */
void ccArrayFree(ccArray*& arr)
{
    if( arr == NULL ) 
    {
        return;
    }
ccArrayRemoveAllObjects(arr); //ccArray에 있는 모든 객체를 다 삭제
free(arr->arr);
free(arr);
arr = NULL;
}


CCNode 의 모든 객체들 addChilde및 removeChild를 할때 추가되는 객체들은 
CCNode 안의 CCArray 멤버변수 m_pChildren 에 저장이 되고 삭제가 되는등 관리가 된다.

CC_PROPERTY_READONLY(CCArray*, m_pChildren, Children)



CCNode::~CCNode(void)
{
    CCLOGINFO( "cocos2d: deallocing" );
    
    unregisterScriptHandler();

    CC_SAFE_RELEASE(m_pActionManager);
    CC_SAFE_RELEASE(m_pScheduler);
    // attributes
    CC_SAFE_RELEASE(m_pCamera);

    CC_SAFE_RELEASE(m_pGrid);
    CC_SAFE_RELEASE(m_pShaderProgram);
    CC_SAFE_RELEASE(m_pUserObject);

    if(m_pChildren && m_pChildren->count() > 0)
    {
        CCObject* child;
        CCARRAY_FOREACH(m_pChildren, child)
        {
            CCNode* pChild = (CCNode*) child;
            if (pChild)
            {
                pChild->m_pParent = NULL;
            }
        }
    }

    // children 등을 전부 삭제한다->CCArray가 삭제되고 CCArray의 소멸자가 생성되므로 위에 있는 것들이 실행되고
   //모든 객체들이 다 삭제된다.
    CC_SAFE_RELEASE(m_pChildren);
}


Trackback 0 And Comment 0

cocos2d-x multi-resolution

|


http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Multi_resolution_support#designResolutionSize

Multi-resolution support(since cocos2d-2.0-x-2.0.4)

안드로이드 기기에서 다양한 해상도를 적용 하기는 어렵다.

Cocos2d-x는 두가지 메서드를 제공한다 CCEGLView::setDesignResolutionSize() 과 CCDirector::setContentScaleFactor() 은 너가 최대한 쉽게 해상도를 변경할수 있게 한다.

The principle

enableRetina 관련 메서드는 v2.0.4. 부터 제거 되었다. On iOS, if thedevice supports retina display, we enable it by default.
Therefore, 너의 실제 스크린 사이즈를 얻기 위해서는 CCEGLView::sharedOpenGLView()->getFrameSize()를 사용해야된다.

예를들어, 이 메서드를 사용하면 아이폰 4s의 가로모드 사이즈는 '960x640'이다.

레티나 장치에 레티나가 아닌 것을 사용 하는 방법은 무엇일까? 

너는 두가지 메서드만 알고 있으면 된다.

하나는 designResolutionSize 이고 다른 하나는 contentScaleFactor 이다.

designResolutionSize


All your game's coordinates rely on design resolution no matter what the size of your device screen. If the UI layout of your game is the same on all resolutions, you just need only a set of coordinates.

디자인 해상도는 설정할수 있다.

CCEGLView::sharedOpenGLView()->setDesignResolutionSize(width, height, policy)

첫번째와 두번째 피라미터 값은 디자인 해상도의 높이와 넓이 이고 세번째 값은 디바이스에 뿌려주는 방식 이다. 

 

세번째 값에 대해서는 맨 마지막에 설명하겠다.

 

You could also use more than one set of resources on different devices to make a better display by CCFileUtils::sharedFileUtils()->setResourceDirectory(path_string),
but you must set the contentScaleFactor too.

Here are some code snippets in HelloCpp project.

1typedef struct tagResource 2{ 3 cocos2d::CCSize size; 4 char directory[100]; 5}Resource; 6 7static Resource smallResource = { cocos2d::CCSizeMake(480, 320), "iphone" }; 8static Resource mediumResource = { cocos2d::CCSizeMake(1024, 768), "ipad" }; 9static Resource largeResource = { cocos2d::CCSizeMake(2048, 1536), "ipadhd" }; 10static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(480, 320); 11

1bool AppDelegate::applicationDidFinishLaunching() { 2 // initialize director 3 CCDirector* pDirector = CCDirector::sharedDirector(); 4 CCEGLView* pEGLView = CCEGLView::sharedOpenGLView(); 5 6 pDirector->setOpenGLView(pEGLView); 7 8 // Set the design resolution 9 pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder); 10 11 CCSize frameSize = pEGLView->getFrameSize(); 12 13 // In this demo, we select resource according to the frame's height. 14 // If the resource size is different from design resolution size, you need to set contentScaleFactor. 15 // We use the ratio of resource's height to the height of design resolution, 16 // this can make sure that the resource's height could fit for the height of design resolution. 17 18 // if the frame's height is larger than the height of medium resource size, select large resource. 19 if (frameSize.height > mediumResource.size.height) 20 { 21 CCFileUtils::sharedFileUtils()->setResourceDirectory(largeResource.directory); 22 pDirector->setContentScaleFactor(largeResource.size.height/designResolutionSize.height); 23 } 24 // if the frame's height is larger than the height of small resource size, select medium resource. 25 else if (frameSize.height > smallResource.size.height) 26 { 27 CCFileUtils::sharedFileUtils()->setResourceDirectory(mediumResource.directory); 28 pDirector->setContentScaleFactor(mediumResource.size.height/designResolutionSize.height); 29 } 30 // if the frame's height is smaller than the height of medium resource size, select small resource. 31 else 32 { 33 CCFileUtils::sharedFileUtils()->setResourceDirectory(smallResource.directory); 34 pDirector->setContentScaleFactor(smallResource.size.height/designResolutionSize.height); 35 } 36 ................... 37 ................... 38}

contentScaleFactor

ContentScaleFactor는 designResolutionSize에 ResourcesSize에서 비율을 설명합니다

ContentScaleFactor describes the ratio from ResourcesSize to designResolutionSize. 일반적으로 'ResourceBackGround.height/DesignResolution.height' 혹은 'ResourceBackGround.width/DesignResolution.width'. 둘중 하나를 사용하며, 너의 게임에 맞는 방법을 선택하면 된다. 
아래 그림의 경우, 우리는 인자를 계산하기 위해 높이를 사용합니다.

Chart 1: Resource Size = 960x640 ; Design Resolution Size = 480x320 ; Target Device Screen Size = 800x480 ; RH/DH=RW/DW=2.0f; NoBorder Policy

When using NoBorder mode, there are some areas of the backgroud out of scope. If you use absolute coordinates based on design resolution size(480x320),
게임의 UI의 일부는 완전히 표시되지 않습니다. 이 문제를 해결하기 위해서는, 당신은 'visible rectangle'을 기준으로 좌표를 설정해야됩니다.

You can get the origin point of 'visible rectange' by 'CCDirector::sharedDirector()->getVisibleOrign()'.

Together with 'CCDirector::sharedDirector()->getVisibleSize()', 당신은 9개의 점을 화면위에서 확인할수 있다.

'Left','Right', 'Top','Bottom','Center','LeftTop','RightTop','LeftBottom' and 'RightBottom'.


게임의 모든 좌표가이 아홉 포인트에 기반 한 경우 게임은 정말 전체 화면으로 표시 될 것입니다
이러한 점을 계산하는 방법에 대해, TestCpp 프로젝트의 'VisibleRect'클래스를 참조하십시오.


Chart 2: Resource Size = 1024x768 ; Design Resolution Size = 480x320 ; Target Device Screen Size = 800x480 ; RH/DH != RW/DW; NoBorder Policy

When RH/DH isn't equal to RW/RH, You should decide to select Width or Height ratio of resource to design resolution.
In the chart 2, we still use height ratio to calculate contentScaleFator, so the height of the resource background will fill for the height of design resolution.
Mark① shows two black rectangle will be in design resolution.
After mapping design resolution to screen, Mark① --> Mark②, and Mark③ will be out of screen. 
Now, you have two choices to make your game becomes full screen. One is to make your background picture wider.
Another is to set the contentScaleFactor based on the ratio of width.

Policies

지금 cocos2d-x는 세 가지 방식을 지원합니다.

Exact fit

The entire application is visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, and the application may appear stretched or compressed.

전체 응용 프로그램은 원래 가로 세로 비율을 유지하기 위해 노력하지 않고 지정된 지역에서 볼 수 있습니다. 왜곡이 발생할 수 있으며, 응용 프로그램은 늘어나거나 압축 나타날 수 있습니다.

No border

The entire application fills the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application.

응용 프로그램의 원래 가로 세로 비율을 유지하면서 전체 응용 프로그램, 왜곡하지 않고 있지만, 아마도 몇 가지 자르기와 함께 지정된 영역을 채 웁니다.

Show all

The entire application is visible in the specified area without distortion while maintaining the original aspect ratio of the application. Borders can appear on two sides of the application.

응용 프로그램의 원래 가로 세로 비율을 유지하면서 전체 응용 프로그램은 왜곡없이 지정된 영역에 표시됩니다. 국경은 응용 프로그램의 두면에 게재 될 수 있습니다.


Chart 3: Resource Size = 1024x768 ; Design Resolution Size = 480x320 ; Target Device Screen Size = 800x480 ; RH/DH != RW/DW; ShowAll Policy

Mark② and Mark③ are both black rectangle areas. But they are different, Mark③ is out of Opengl Viewport, so you can't put any game elements onto it.
Mark② appears because RW/RH isn't equal to DW/DH, it's in the Opengl Viewport, you can place your game elements onto it.

  • You need to use relative coordinates only in NoBorder mode. Generally, developer uses NoBorder mode for better display


Trackback 0 And Comment 0

cocos2d-x 스크롤 테이블뷰 예제 소스

|

cocos2d-x 스크롤 예제 소스


TableViewTest.zip


Trackback 0 And Comment 0

cocos2d-x CCString 분리후 CCArray 에 넣기( 문자열 분리하기)

|
CCString 에 있는 문자열을 분리하고 싶은 문자를 어규먼트에 넣으면 분리되서 각각 문자열이 CCArray에 집어넣는 함수
아래 예제는 띄어쓰기로 각 문자를 분리 했다.
exam)

char * name = "This is my book!!";
cocos2d::CCString * tStr = cocos2d::CCString::create(name);
CCArray * tAry = tStr->componentsSeparatedByCharactersInSet(" "); //문자열 분리 함수
CCObject * pObj = NULL;
CCARRAY_FOREACH(tAry, pObj)
{
CCString * str = (CCString *) pObj;
CCLog("%s",str->getCString());
}

결과값:
This
is
my
book!!

cocos2d::CCArray * CCString::componentsSeparatedByCharactersInSet(const char * Separator)
{
//구분자를 사용해서 Array배열 반환
CCAssert( length() < 1024, "OVER LengTh!!");
char tBuf[1024];

strncpy(tBuf,getCString(),sizeof(tBuf));

char* token = strtok(tBuf, Separator);  
cocos2d::CCArray * tAry = cocos2d::CCArray::create();
tAry->addObject(CCString::create(token));
while (token)  
{  
token = strtok(NULL, Separator); 
if(token!=NULL)
tAry->addObject(CCString::create(token));
}  
return tAry;
}


Trackback 0 And Comment 0

cocos2d-x 의 메모리 관리

|
cocos2d-x 는 아이폰의 autorelease Pool 개념을 사용하여 c++ 에서도 같은 방식으로 메모리 관리를 한다.

c++에서는 new를 해주면 delete를 해주듯이.

cocos2d-x는 new로 객체를 생성시 release()를 호출하여 메모리를 해제한다.

 

 

cocos2d-x의 모든 클래스는 CCObject클래스를 상속받는데 CCObject클래스는 생성자에서 m_uReference라는 값을 1로 만들어준다.

 

 

 m_uReference 의 값을 확인하는 함수는 retainCount()이다.

 

CCNode * node = new CCNode();   //CCNode의 m_uReference = 1 이됨

this->addChild(node);                    //CCNode의 m_uReference = 2 가됨   

this->removeChild(node,true);               //CCNode의 m_uReference = 1 가됨   

node->release();                          //CCNode의 m_uReference = -17891602(쓰레기값) 메모리해제됨    메모리 할당한값 전부 해제


addChilde시 m_uReference가 1 증가하고 , removeChild시  m_uReference가 1 감소한다. this의 m_uReference는 그대로 이다.

 

 

(메모리가 초기화 된것은 visual stduio에서 디버그-창-메모리-메모리1을 누르고 디버깅 모드에서 해당 주소값 입력후 초기화 되는지 확인하면 된다. 초기화가 되면 fe ee fe ee 이런식으로 값이 들어간다)

 

 

 

 

 

 

안전한 코드는 release()후 node = NULL을 입력시 안전한 코드가 된다. C++에서 delete후 null을 입력하는것과 마찬가지이다.

 #define SAFE_RELEASE(p) if ((p) != NULL) { delete (p); (p) = NULL; 

 

이런식으로 정의한후

SAFE_RELEASE(node);로 해도 된다


 

cocos2d-x에서도 자체 매크로를 제공한다


#define CC_SAFE_DELETE(p)            do { if(p) { delete (p); (p) = 0; } } while(0)

#define CC_SAFE_DELETE_ARRAY(p)     do { if(p) { delete[] (p); (p) = 0; } } while(0)

#define CC_SAFE_FREE(p)                do { if(p) { free(p); (p) = 0; } } while(0)

#define CC_SAFE_RELEASE(p)            do { if(p) { (p)->release(); } } while(0)

#define CC_SAFE_RELEASE_NULL(p)        do { if(p) { (p)->release(); (p) = 0; } } while(0)

#define CC_SAFE_RETAIN(p)            do { if(p) { (p)->retain(); } } while(0)

#define CC_BREAK_IF(cond)            if(cond) break


 

알아서 입맛에 맞게 매크로를 사용하면 된다.

 

 

void CCObject::retain(void)

{

    CCAssert(m_uReference > 0, "reference count should greater than 0");

 

    ++m_uReference;

}

 

void CCObject::release(void)

{

    CCAssert(m_uReference > 0, "reference count should greater than 0");

    --m_uReference;

 

    if (m_uReference == 0)

    {

        delete this;

    }

}

autoRelease란 사용자가 메모리 관리에 신경을 덜 써도 된다. ( m_uReference 가 1이면 자동으로 메모리에서 해제된다.)

 

 

싱글턴으로 선언된  CCPoolManager에서 관리되면 CCPoolManager가 메모리에서 해제될때 CCPoolManager의 객체들을 전부

release()해주므로 CCPoolManager의 객체중 m_uReference가 1인 것들은 0이되고 자동으로 delete가 된다.

autoRelease는 보통 create()메서드 (2.0이상부터는 전부 create로 변경되었다.) 로 호출되는건 전부 라고 생각하면 된다.

CCNode * node = CCNode::create(); 이런식으로 호출하면 된다.

 

 

CCNode * CCNode::create(void)

{

CCNode * pRet = new CCNode();

pRet->autorelease();

return pRet;

}

 

 

 

CCObject* CCObject::autorelease(void)

{

    CCPoolManager::sharedPoolManager()->addObject(this);

    return this;

}

Trackback 0 And Comment 0

cocos2d-x 멀티해상도 지원

|

그림파일 이미지 해상도 960*640 (그림은 480*320으로 되있지만 960*640 이미지이다.)

디자인 해상도 480*320 (실제 작업 해상도) 터치좌표 반영되는 해상도 이다

디바이스 해상도 800*480 (가장 보편적인 디바이스 해상도 갤s 기준)

 kResolutionExactFit.png

 

 

kResolutionNoBorder.png

 

kResolutionShowAll.png

 

 

 

 

1. noborder - 2번째

화면은 가득차지만 일부영역은 보여주지 못한다. 가로 세로 증가하는(Scale) 비율은 같다.

 

2. showAll -3 번째

전체 그림을 화면 안에 다 보여준다. 레터박스가 보일수 있으며 , 가로 세로 증가하는 비율은 같다.

 

3. ExactFit - 1번째

전체 그림을 화면 안에 다 보여준다. 가로 세로 증가하는 비율이 다르다.

 

 

 

 

CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();

CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();

 

visibleSize 실제 화면에 보이는 해상도

origin 짤린 해상도 기준으로 시작하는 x,y 좌표

 

일반적으로 개발자는 noborder(테두리없음) 을 많이사용한다고 한다.

 

터치좌표 기준

1.noborder은

visibleSize [480, 288]

origin [-0, 16]

짤린하면은 총 32픽셀

480*320 해상도 기준(DESIGN_RESOLUTION) 으로 17~304까지 터치가 먹히고

위아래 16포인트는 터치가 안먹힌다. (짤린화면은 총 32픽셀)

origin 시작지점 16부터

2.showAll은

visibleSize [480, 320]

origin [0, 0]

검은색 짤린 화면은 터치가 안먹히고 보여지는 해상도내에서 480*320내에는 다 터치가 먹힌다.

3.ExactFit은

visibleSize [480, 320]

origin [0, 0]

전부 터치가 먹힘

 

 

Trackback 0 And Comment 0
prev | 1 | 2 | 3 | 4 | next