예제 #1
0
파일: ChatInput.cpp 프로젝트: chaosren/HHHH
void ChatInput::ShowItems()
{
	if (!m_itemLayer) 
	{
		m_itemLayer = new NDUIMenuLayer();
		m_itemLayer->Initialization();
		m_itemLayer->GetCancelBtn()->SetDelegate(this);
		m_itemLayer->SetDelegate(this);
		
		NDUIRecttangle* bkg = new NDUIRecttangle();
		bkg->Initialization();
		bkg->SetColor(ccc4(253, 253, 253, 255));
		bkg->SetFrameRect(CCRectMake(0, m_itemLayer->GetTitleHeight(), 480, m_itemLayer->GetTextHeight()));
		m_itemLayer->AddChild(bkg);
		
		NDPicture* picItem = NDPicturePool::DefaultPool()->AddPicture(GetImgPath("titles.png"));
		picItem->Cut(CCRectMake(76, 120, 103, 19));
		
		NDUIImage* image = new NDUIImage();
		image->Initialization();
		image->SetPicture(picItem, true);
		image->SetFrameRect(CCRectMake(190, 5, picItem->GetSize().width, picItem->GetSize().height));
		m_itemLayer->AddChild(image);
		
		m_itemBag = new GameItemBag();
		m_itemBag->Initialization(ItemMgrObj.GetPlayerBagItems());
		m_itemBag->SetPageCount(ItemMgrObj.GetPlayerBagNum());
		m_itemBag->SetDelegate(this);
		m_itemBag->SetFrameRect(CCRectMake(100, 30, ITEM_BAG_W, ITEM_BAG_H));
		m_itemLayer->AddChild(m_itemBag);
	}
	NDDirector::DefaultDirector()->GetRunningScene()->AddChild(m_itemLayer, CHAT_INPUT_Z);
	this->Hide();
}
예제 #2
0
void NDUIButton::drawLongTouch()
{
	NDPicture *pic = NULL;

	if (m_touchDownImage != NULL)
	{
		pic = m_touchDownImage;
	}
	else
	{
		pic = m_image ? m_image : m_picBG;
	}

	if (pic)
	{
		pic->SetColor(ccc4(255, 255, 255, 255));

		//** chh 2012-07-31 修改button放大效果 **//
		/*
		 CCRect rect = CCRectMake(scrRect.origin.x - 5 * fScale, 
		 scrRect.origin.y - 5 * fScale, 
		 scrRect.size.width + 10 * fScale, 
		 scrRect.size.height + 10 * fScale);
		 
		 */

		CCRect scrRect = this->GetScreenRect();
		pic->DrawInRect(scrRect);
		pic->SetColor(m_normalImageColor);
	}
}
예제 #3
0
파일: UIDialog.cpp 프로젝트: chaosren/HHHH
void CUIDlgOptBtn::Initialization()
{
	NDUIButton::Initialization();
	this->CloseFrame();
	
	CCSize winsize	= CCDirector::sharedDirector()->getWinSizeInPixels();
	CCRect rect		= CCRectMake(0, 0, winsize.width * 0.15, winsize.height * 0.15);
	
	m_sprTip = new CUISpriteNode;
	m_sprTip->Initialization();
	m_sprTip->SetFrameRect(rect);
	//m_sprTip->ChangeSprite(NDPath::GetAniPath("button.spr").c_str());//modified by ZhangDi 这个控件不需要做显示,但是其他地方有依赖到控件的框体大小,所以把显示的动画给屏蔽掉

	//新增提示图片
	NDPicture *test =  NDPicturePool::DefaultPool()->AddPicture(NDPath::GetSMImgPath("General/arrows/icon_arrows4.png"));
	test->Cut(CCRectMake(0.0f, 0.0f, 72.0f, 32.0f));
	NDUIImage *testimg = new NDUIImage;
	testimg->Initialization();
	testimg->SetPicture(test);
	testimg->SetFrameRect(CCRectMake(0.0f, winsize.height*0.015, 72.0f*ANDROID_SCALE, 32.0f*ANDROID_SCALE));

	this->AddChild(testimg, 1000);

	this->AddChild(m_sprTip);
	
	m_textHpyerlink = new CUIHyperlinkText;
	m_textHpyerlink->Initialization();
	m_textHpyerlink->SetFrameRect(CCRectMake(winsize.width*0.8f, 0, 0, 0));
	m_textHpyerlink->EnableLine(NO);// EnableLine
	this->AddChild(m_textHpyerlink);
}
예제 #4
0
void NDUIEdit::draw_ios_ime() //for ios
{
	CCRect scrRect;

	if (m_pPlatformInput)
	{
		//** chh 2012-06-19 **//
		scrRect = m_pkTextLabel->GetFrameRect();
		CCSize textSize = getStringSize(TEST_TEXT,m_pkTextLabel->GetFontSize());
		int HBorder = (this->GetScreenRect().size.height-textSize.height)/2;
		m_pPlatformInput->SetFrame(scrRect.origin.x, scrRect.origin.y+HBorder, 
									scrRect.size.width, scrRect.size.height);
	}

	if (m_bRecacl && m_pPlatformInput)
	{
		m_pPlatformInput->SetText(m_strText.c_str());
		m_pPlatformInput->EnableSafe(m_bPassword);
//		m_pPlatformInput->SetStyleNone();
		m_bRecacl = false;
	}

	NDPicture* pic = m_picImage;

	if (m_pPlatformInput && m_pPlatformInput->IsInputState() && m_picFocusImage)
	{
		pic	= m_picFocusImage;
	}

	if (pic)
	{
		pic->DrawInRect(scrRect);
	}
}
예제 #5
0
NDPicture* CUIChatText::CreateFacePicture(unsigned int index)
{
	NDPicture* result = NULL;
	if (index < 36) 
	{
		int row = index / 6;
		int col = index % 6;

		result = NDPicturePool::DefaultPool()->AddPicture(NDPath::GetImgPath("Res00/sm_face.png"));	
		result->Cut(CCRectMake(80 * col, 80 * row , 80, 80));
	}
	return result;
}
예제 #6
0
파일: DramaUI.cpp 프로젝트: chaosren/HHHH
void DramaChatLayer::SetFigure(std::string filename, bool bReverse, int nCol, int nRow)
{
	NDNode* node = GetChild(m_nTagFigure);

	if (node && node->IsKindOfClass(RUNTIME_CLASS(NDUIImage)))
	{
		NDPicture* pic = NDPicturePool::DefaultPool()->AddPicture(
				filename);
		pic->SetReverse(bReverse);

		int nCutX= nCol * 256;
		int nCutY= nRow * 256;
		pic->Cut(CCRectMake(nCutX+1, nCutY+1, 255, 255));

		((NDUIImage*) node)->SetPicture(pic);
	}
}
예제 #7
0
NDPicture* CtrlBase::GetPicture(string& filename, CTRL_UV& uv)
{
	if (filename.empty()) return NULL;

	const string imgPath = NDPath::GetGameResPath(filename.c_str());
	
	NDPicture* pkPicture = NDPicturePool::DefaultPool()->AddPicture(imgPath.c_str());

	if (pkPicture)
	{		
		pkPicture->Cut(CCRectMake(uv.x, uv.y, uv.w, uv.h ) );

		return pkPicture;
	}

	return NULL;
}
예제 #8
0
void CSMLoginScene::OnEvent_LoginOKNormal( int iAccountID )
{
	CCLog( "@@login03: OnEvent_LoginOKNormal()\r\n" );

	m_iAccountID = iAccountID;
#ifdef USE_MGSDK
    if(m_pLayerUpdate)
    {
        NDUIImage * pImage = (NDUIImage *)m_pLayerUpdate->GetChild( TAG_CTRL_PIC_BG);
        if ( pImage )
        {
            NDPicture * pPicture = new NDPicture;
            std::string str = SZ_UPDATE_BG_PNG_PATH;
            pPicture->Initialization( NDPath::GetUIImgPath( str.c_str() ).c_str() );
            pImage->SetPicture( pPicture, true );
        }
    }
#endif
	
#if UPDATE_ON == 0
		CloseWaitingAni();
		StartEntry();
#endif
#if UPDATE_ON == 1
	const char*	pszUpdateURL	= SZ_UPDATE_URL;//ScriptMgrObj.excuteLuaFuncRetS( "GetUpdateURL", "Update" );//此时Lua脚本未加载……
	if ( !pszUpdateURL )
	{
		CloseWaitingAni();
		StartEntry();
		return;
	}
		
	if (m_pLabelPromtp)
	{
		m_pLabelPromtp->SetText( NDCommonCString2(SZ_CONNECT_SERVER).c_str() );
		m_pLabelPromtp->SetVisible( true );
	}
	if ( !NDBeforeGameMgrObj.CheckClientVersion( pszUpdateURL ) )
	{
		CloseWaitingAni();
		StartEntry();
	}
#endif
}
예제 #9
0
파일: ChatInput.cpp 프로젝트: chaosren/HHHH
void ChatInput::ShowExpressions()
{
	if (!m_expressionLayer) 
	{
		m_expressionLayer = new NDUIMenuLayer();
		m_expressionLayer->Initialization();
		m_expressionLayer->GetCancelBtn()->SetDelegate(this);
		m_expressionLayer->SetDelegate(this);
		
		NDUIRecttangle* bkg = new NDUIRecttangle();
		bkg->Initialization();
		bkg->SetColor(ccc4(253, 253, 253, 255));
		bkg->SetFrameRect(CCRectMake(0, m_expressionLayer->GetTitleHeight(), 480, m_expressionLayer->GetTextHeight()));
		m_expressionLayer->AddChild(bkg);
		
		NDPicture* picExpression = NDPicturePool::DefaultPool()->AddPicture(GetImgPath("titles.png"));
		picExpression->Cut(CCRectMake(180, 120, 100, 19));
		
		NDUIImage* image = new NDUIImage();
		image->Initialization();
		image->SetPicture(picExpression, true);
		image->SetFrameRect(CCRectMake(190, 5, picExpression->GetSize().width, picExpression->GetSize().height));
		m_expressionLayer->AddChild(image);
		
		for (int index = 0; index < 25; index++) 
		{
			NDUIButton* btn = new NDUIButton();
			btn->Initialization();
			btn->SetTag(tag_expression_begin + index);
			btn->SetDelegate(this);
			
			NDPicture* pic = NDPicturePool::DefaultPool()->AddPicture(GetImgPath("face.png"));				
			int row = index / 5;
			int col = index % 5;
			pic->Cut(CCRectMake(15 * col, 15 * row , 15, 15));
			
			btn->SetImage(pic, false, CCRectZero, true);
			btn->SetFrameRect(CCRectMake(80 + col * 60, 35 + row * 50, 40, 40));			
			m_expressionLayer->AddChild(btn);
		}		
	}
	NDDirector::DefaultDirector()->GetRunningScene()->AddChild(m_expressionLayer, CHAT_INPUT_Z);
	this->Hide();
}
예제 #10
0
파일: DrawAni.cpp 프로젝트: korman/Temp
bool DrawAni::doDraw(const int frameIndex, const AniModify* mod_lev2,
					 const AniModify* mod_lev3)
{
	if (!m_pkAni || !m_pkInstance || !m_pkInstance->getOwnerNode())
		return false;

	// get picture to draw
	NDPicture* pkPicture = getPicture(m_pkAni, frameIndex);
	if (!pkPicture)
		return false;

	// get node screen rect
	CCRect kNodeRect;
	NDNode* pkOwnerNode = m_pkInstance->getOwnerNode();

	if (pkOwnerNode->IsA(RTCLS(NDTileObj)))
	{
		NDTileObj* pkTileObj = (NDTileObj*) pkOwnerNode;
		if (pkTileObj->isPlayer() || pkTileObj->isPath())
			kNodeRect = pkOwnerNode->GetScreenRect();
		else
			kNodeRect = pkOwnerNode->GetPushScreenRect();
	}
	else
	{
		kNodeRect = pkOwnerNode->GetScreenRect();
	}

	// node center pos (caution: world map tile obj!)
	CCPoint centerPos = CCPointMake(
		kNodeRect.origin.x + kNodeRect.size.width * 0.5f,
		kNodeRect.origin.y + kNodeRect.size.height * 0.5f);

	// get node scale (recursive)
	float nodeScaleX = pkOwnerNode->GetScaleX_R();
	float nodeScaleY = pkOwnerNode->GetScaleY_R();

	// add offset
	int sign = pkOwnerNode->isReverse() ? -1 : 1;
	centerPos.x += m_pkAni->m_kAniModifyEx.getOffsetX() * COORD_SCALE_X_960 * nodeScaleX
		* sign;
	centerPos.y += m_pkAni->m_kAniModifyEx.getOffsetY() * COORD_SCALE_Y_960 * nodeScaleY;

	// apply mod: offset
	if (mod_lev2)
	{
		centerPos.x += mod_lev2->getOffsetX() * COORD_SCALE_X_960 * nodeScaleX
			* sign;
		centerPos.y += mod_lev2->getOffsetY() * COORD_SCALE_Y_960 * nodeScaleY;
	}
	if (mod_lev3)
	{
		centerPos.x += mod_lev3->getOffsetX() * COORD_SCALE_X_960 * nodeScaleX
			* sign;
		centerPos.y += mod_lev3->getOffsetY() * COORD_SCALE_Y_960 * nodeScaleY;
	}

	// calculate pic size
	CCSize picSize = pkPicture->GetSize();
	if (m_pkAni->m_kAniModifyEx.getStretch())
	{
		picSize.width *= COORD_SCALE_X_960;
		picSize.height *= COORD_SCALE_Y_960;
	}
	else
	{
		picSize.width *= RESOURCE_SCALE_960;
		picSize.height *= RESOURCE_SCALE_960;
	}

	if (m_pkAni->m_kAniModifyEx.getFullScreen())
	{
		// apply fullscreen 
		picSize = CCDirector::sharedDirector()->getWinSizeInPixels();
	}
	else
	{
		// size override
		if (m_pkAni->m_kAniModifyEx.sizeOverride())
		{
			picSize = CCSizeMake(m_pkAni->m_kAniModifyEx.getWidth(), m_pkAni->m_kAniModifyEx.getHeight());
		}

		// apply node scale
		picSize.width *= nodeScaleX;
		picSize.height *= nodeScaleY;

		// apply scale
		picSize.width *= m_pkAni->m_kAniModifyEx.getScale();
		picSize.height *= m_pkAni->m_kAniModifyEx.getScale();

		// apply mod: scale
		if (mod_lev2)
		{
			picSize.width *= mod_lev2->getScale();
			picSize.height *= mod_lev2->getScale();
		}
		if (mod_lev3)
		{
			picSize.width *= mod_lev3->getScale();
			picSize.height *= mod_lev3->getScale();
		}
	}

	// apply alpha
	applyAlpha(pkPicture, mod_lev2);

	// apply HSL
	applyHSL(pkPicture, mod_lev2);

	// target rect to draw in
	CCRect picRect = CCRectMake(centerPos.x - picSize.width * 0.5f,
		centerPos.y - picSize.height * 0.5f, picSize.width, picSize.height);

	// check to disable scissor
	if (!isAllowScissor())
	{
		NDDirector::DefaultDirector()->DisableScissor();
	}

	// draw
	if (m_pkInstance && m_pkInstance->getOwnerNode())
	{
		// apply from action: opacity/rotation/gaussianBlur
		NDNode* pkOwnerNode = m_pkInstance->getOwnerNode();
		pkPicture->SetOpacity(pkOwnerNode->getRGBA()->getOpacity());
		pkPicture->SetRotation(pkOwnerNode->getCCNode()->getRotation());
		pkPicture->SetRotationX(pkOwnerNode->getCCNode()->getRotationX());
		pkPicture->SetRotationY(pkOwnerNode->getCCNode()->getRotationY());
		pkPicture->setGaussianBlur(pkOwnerNode->getCCNode()->getGaussianBlur());

		// toggle reverse
		bool bReverse = m_pkAni->m_kAniModifyEx.getReverse();
		if (pkOwnerNode->isReverse())
			bReverse = !bReverse;
		pkPicture->SetReverse(bReverse);
	}
	pkPicture->DrawInRect(picRect);
}
예제 #11
0
//===========================================================================
void CSMLoginScene::OnTimer( OBJID idTag )
{
	static bool bFirst = true;

	if (bFirst)
	{
		LOGD("Entry First OnTimer");
		//idTag = TAG_TIMER_UPDATE;
		bFirst = false;
	}

	if ( idTag == TAG_TIMER_UPDATE ) 
	{
		if ( !rename( m_strSavePath.c_str(), m_strSavePath.c_str() ) )
		{
			if ( remove( m_strSavePath.c_str() ) )
			{ 
				m_pTimer->KillTimer(this, TAG_TIMER_UPDATE);
				return;
			}
		}

		FromUrl(m_strUpdateURL.c_str());
		ToPath(m_strSavePath.c_str()); 
		Download();
		m_pTimer->KillTimer(this, TAG_TIMER_UPDATE);
	}
	else if ( idTag == TAG_TIMER_DOWNLOAD_SUCCESS )
	{
		m_pTimer->KillTimer(this, TAG_TIMER_DOWNLOAD_SUCCESS);
        
		LOGD("Entry TAG_TIMER_DOWNLOAD_SUCCESS process.");
		UnZipFile( m_strSavePath.c_str(), m_strCachePath.c_str());
	}
    else if ( idTag == TAG_TIMER_UNZIP_SUCCESS )
	{
		m_pTimer->KillTimer(this, TAG_TIMER_UNZIP_SUCCESS);
		if ( remove(m_strSavePath.c_str()) )
		{
		    NDLog("delete:%s failed",m_strSavePath.c_str());
		    //return;
		}
        std::string szListFile = NDPath::GetCashesPath() + SZ_DEL_FILE;
		DeleteFileFromFile( szListFile );
    
		if(kDeqUpdateUrl.size() > 0)
		{
		    kDeqUpdateUrl.pop_front();
		}

		PackageCount++;
		//查找下载队列
		if (kDeqUpdateUrl.size() > 0)
		{
		    //定义保存路径
		    m_strUpdateURL = *kDeqUpdateUrl.begin();
		    //m_savePath = [[NSString stringWithFormat:@"%s/update%d.zip", m_cachPath.c_str(), PackageCount] UTF8String];
		    m_pTimer->SetTimer( this, TAG_TIMER_UPDATE, 0.5f );
		    StartDownload();
		}
		else
		{
		    //跳转到启动界面
		    StartEntry();
		}
	}
	else if ( TAG_TIMER_CHECK_WIFI == idTag )
	{
		//如果检测没开启WIFI则不断检测//
    	if ( NDBeforeGameMgrObj.isWifiNetWork() )
    	{
			m_pTimer->KillTimer( this, TAG_TIMER_CHECK_WIFI );
			CloseConfirmDlg();
			StartUpdate();
    	}
	}
	else if ( TAG_TIMER_CHECK_UPDATE == idTag )
	{
        m_pTimer->KillTimer(this, TAG_TIMER_CHECK_UPDATE);
        ShowUpdateOff();
	}
	else if ( TAG_TIMER_CHECK_COPY == idTag )
	{
        int copyStatus = NDBeforeGameMgr::GetCopyStatus();
        switch (copyStatus) 
        {
            case -1:
                m_pTimer->KillTimer( this, TAG_TIMER_CHECK_COPY );
                //NSLog( @"Copy files error!" );
                exit(0);
                break;
            case 0:
                break;
            case 1:
                m_pTimer->KillTimer( this, TAG_TIMER_CHECK_COPY );
                NDBeforeGameMgrObj.doNDSdkLogin();
                ShowWaitingAni();
                break;
            default:
                break;
        }
	}
    else if ( TAG_TIMER_FIRST_RUN == idTag )
	{
		LOGD("Entry TAG_TIMER_FIRST_RUN == idTag");
		m_pTimer->KillTimer( this, TAG_TIMER_FIRST_RUN );
		CreateUpdateUILayer();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
		CCLog( "@@login02: to call OnEvent_LoginOKNormal()\r\n" );

        m_iAccountID = NDBeforeGameMgrObj.GetCurrentUser();
		OnEvent_LoginOKNormal(m_iAccountID);
#else
#ifdef USE_MGSDK
		NDUIImage * pImage = (NDUIImage *)m_pLayerUpdate->GetChild( TAG_CTRL_PIC_BG);
		if ( pImage )
		{
			NDPicture * pPicture = new NDPicture;
			pPicture->Initialization( NDPath::GetUIImgPath( SZ_MOBAGE_BG_PNG_PATH ).c_str() );
			pImage->SetPicture( pPicture, true );
		}
#endif
#if CACHE_MODE == 1
    	if ( NDBeforeGameMgrObj.CheckFirstTimeRuning() )
        {
        	if ( m_pLabelPromtp )
            {
        		m_pLabelPromtp->SetText( NDCommonCString2(SZ_FIRST_INSTALL).c_str() );
        		m_pLabelPromtp->SetVisible( true );
                ShowWaitingAni();
#ifdef USE_MGSDK
        		m_pLabelPromtp->SetVisible( false );//Mobage的版本暂将文字绘在背景图上
#endif
            }
            m_pTimer->SetTimer( this, TAG_TIMER_CHECK_COPY, 0.5f );
        }
        else
#endif
        {
            NDBeforeGameMgrObj.doNDSdkLogin();
            ShowWaitingAni();
		}
#endif
    	//CreateUpdateUILayer();
		//NDBeforeGameMgrObj.CheckClientVersion(SZ_UPDATE_URL);
	}
	else if ( TAG_TIMER_LOAD_RES_OK == idTag )
	{
		m_pTimer->KillTimer( this, TAG_TIMER_LOAD_RES_OK );
		CloseWaitingAni();
		CloseUpdateUILayer();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
		//if ( m_iAccountID == 0 )
		m_iAccountID = ScriptMgrObj.excuteLuaFuncRetN( "GetAccountID", "Login_ServerUI" );
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
		m_iAccountID = NDBeforeGameMgrObj.GetCurrentUser();
#endif
		ScriptMgrObj.excuteLuaFunc( "ShowUI", "Entry", m_iAccountID );
		//    ScriptMgrObj.excuteLuaFunc("ProecssLocalNotification", "MsgLoginSuc");
	}
}
예제 #12
0
StageUI_Base::StageUI_Base()
{
    m_pkUIPercentLabel = NULL;
    m_pkUILayer = 0;

    m_pkUnzipProgress = 0;
    m_pkBackgroundImage = 0;
    m_pkProgressBgImage = 0;
    m_pkUnzipTextImage = 0;

    m_pkUILayer = new NDUIDialog;
    m_pkUILayer->Initialization();
    m_pkUILayer->SetAlwaysFullScreen(true);
    m_pkUILayer->NoMask();
    getPercentLabel();

    if (m_pkUILayer)
    {
        m_pkUILayer->AddChild( m_pkUIPercentLabel, 1 );
        m_pkUIPercentLabel->SetText(CONVERT_GBK_TO_UTF8("正在检查是否需要更新……"));
    }

    m_pkBackgroundImage = new NDUIImage;
    m_pkBackgroundImage->Initialization();

    m_pkUnzipTextImage = new NDUIImage;
    m_pkUnzipTextImage->Initialization();

    m_pkProgressBgImage = new NDUIImage;
    m_pkProgressBgImage->Initialization();

    m_pkUnzipProgress = new NDUIExp;
    m_pkUnzipProgress->Initialization();
    m_pkUnzipProgress->SetNoText();
    m_pkUnzipProgress->setMaskMode(true);
    m_pkUnzipProgress->setMaskPercent(0.1f);
    //m_pkUnzipProgress->SetFgDrawFirst();

    unsigned long uiBgDataSize = 0;
    unsigned long uiBgProgressDataSize = 0;
    unsigned long uiFgProgressDataSize = 0;
    unsigned long uiProgressEffectSize = 0;
    unsigned long uiUnzipTextSize = 0;

    unsigned char* pszBgImageFileData = 0;
    unsigned char* pszBgProgressImageData = 0;
    unsigned char* pszFgProgressImageData = 0;
    unsigned char* pszProgressEffectData = 0;
    unsigned char* pszUnzipTextData = 0;

    string strPath = "";
    float fWinScale = 2.0f;
    CCSize kWinSize = ccz(0,0);
    CCSize kRealWinSize = CCDirector::sharedDirector()->getWinSize();

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
    strPath = "assets/install_res/";
    fWinScale = 1.0f;
#elif (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
    strPath = "../install_res/";
    fWinScale = 2.0f;
#endif

    CCRect kRect = m_pkUILayer->GetFrameRect();
    float fHeight = CCDirector::sharedDirector()->getWinSize().height;
    float fWidth = CCDirector::sharedDirector()->getWinSize().width;

    float fWindowScale = fHeight / fWidth;
    float fRealScreenHeight = 960.0f / fWinScale;
    float fRealScreenWidth = 640.0f / fWinScale;

    float fCtrlScale = fWidth / fRealScreenWidth;
    float fCurHeight = (fHeight - fRealScreenHeight * fCtrlScale) / 2.0f * fWinScale;
    kWinSize = ccz(fRealScreenWidth * fCtrlScale * fWinScale,fRealScreenHeight * fCtrlScale * fWinScale);

    m_pkBackgroundImage->SetFrameRect(CCRectMake(0,fCurHeight,kWinSize.width,kWinSize.height));
    //m_nOffsetHeight = fCurHeight;

    m_strBgImageFile = strPath + string("bg_image.png");
    m_strBgProgressImage = strPath + string("bg_progress.png");
    m_strFgProgressImage = strPath + string("fg_progress.png");
    m_strProgressEffect = strPath + string("progress_effect.png");
    m_strUnzipTextFile = strPath + string("load_text.png");

    pszBgImageFileData =
        __getFileData(m_strBgImageFile.c_str(),"rb",&uiBgDataSize);
    pszBgProgressImageData =
        __getFileData(m_strBgProgressImage.c_str(),"rb",&uiBgProgressDataSize);
    pszFgProgressImageData =
        __getFileData(m_strFgProgressImage.c_str(),"rb",&uiFgProgressDataSize);
    pszProgressEffectData =
        __getFileData(m_strProgressEffect.c_str(),"rb",&uiProgressEffectSize);
    pszUnzipTextData =
        __getFileData(m_strUnzipTextFile.c_str(),"rb",&uiUnzipTextSize);

    if (0 == pszBgImageFileData || 0 == pszBgProgressImageData ||
            0 == pszFgProgressImageData || 0 == pszProgressEffectData || 0 == pszUnzipTextData)
    {
        WriteConErr("Data Error!!\n");
        return;
    }

    float fProgressWidth = kWinSize.width * 0.9f;

    CCRect kProgressRect = CCRectMake((kWinSize.width - fProgressWidth) / 2.0f,
                                      kWinSize.height * 0.8f + fCurHeight, fProgressWidth,
                                      fProgressWidth * 0.086207);

    // 	kProgressRect.origin.x *= fWinScale;
    // 	kProgressRect.origin.y *= fWinScale;
    // 	kProgressRect.size.width *= fWinScale;
    // 	kProgressRect.size.height *= fWinScale;

    CCRect kTextRect = kProgressRect;
    kTextRect.origin.y -= kTextRect.size.height;

    m_pkUIPercentLabel->SetFrameRect(kTextRect);

    m_pkUnzipProgress->SetFrameRect(kProgressRect);
    m_pkProgressBgImage->SetFrameRect(kProgressRect);

    //GetUIRootNew()->addDlg(m_pkUILayer);

    NDPicture* pkUnzipTextPicture = new NDPicture;
    pkUnzipTextPicture->Initialization(pszUnzipTextData, uiUnzipTextSize);

    NDPicture* pkBgPicture = new NDPicture;
    pkBgPicture->Initialization(pszBgImageFileData, uiBgDataSize);

    NDPicture* pkEffectPicture = new NDPicture;
    pkEffectPicture->Initialization(pszProgressEffectData,
                                    uiProgressEffectSize);

    NDPicture* pkBgProgressPic = new NDPicture;
    pkBgProgressPic->Initialization(pszBgProgressImageData,
                                    uiBgProgressDataSize);

    NDPicture* pkFgProgressPic = new NDPicture;
    pkFgProgressPic->Initialization(pszFgProgressImageData,
                                    uiFgProgressDataSize);

    m_pkBackgroundImage->SetPicture(pkBgPicture);
    m_pkUnzipProgress->SetPicture(pkBgProgressPic, pkFgProgressPic);
    m_pkProgressBgImage->SetPicture(pkEffectPicture);
    m_pkUnzipTextImage->SetPicture(pkUnzipTextPicture);
    //m_pkUnzipTextImage->SetFrameRect(kUnzipTextRect);

    //m_pkUILayer->SetZOrder(1000);
    GetUIRootNew()->AddChild(m_pkUILayer);
    showProgress(false);
    m_pkUILayer->AddChild(m_pkBackgroundImage, 0);
    m_pkUILayer->AddChild(m_pkProgressBgImage, 2);
    m_pkUILayer->AddChild(m_pkUnzipProgress, 1);
}