As a percentage placing in the load bar

Results 1 to 3 of 3
  1. #1
    Enthusiast juanjunio is offline
    MemberRank
    Jul 2010 Join Date
    49Posts

    As a percentage placing in the load bar

    As I put the percentage while charging the gunz ....

    the code at the end in ZIntialLoading.cpp is

    Code:
    void ZLoadingProgress::Draw() 
    {
        float fTotalProgress = m_fTotalProgressStart + m_fThisAmount * m_fCurrentProgress;
    #ifdef _DEBUG // Ȥ½Ã µÇµ¹¾Æ°¡´Â°æ¿ìÀÎÁö üũ
    	//_ASSERT(m_fLastProgress<=fTotalProgress);
    	m_fLastProgress=fTotalProgress;
    #endif
    
    
    	ZGetInitialLoading()->SetLoadingStr( m_szName );
    	ZGetInitialLoading()->SetPercentage( fTotalProgress * 100.f );
    	ZGetInitialLoading()->Draw( MODE_DEFAULT, 0 , true );
    }
    so normal text would come charging .... but I place him either side of the text that the percentage loaded ...


    able to generate the code to place the percentage but the text is removed .. the percentage loading code would look like right there:

    Code:
    void ZLoadingProgress::Draw() 
    {
        float fTotalProgress = m_fTotalProgressStart + m_fThisAmount * m_fCurrentProgress;
    #ifdef _DEBUG // Ȥ½Ã µÇµ¹¾Æ°¡´Â°æ¿ìÀÎÁö üũ
    	_ASSERT(m_fLastProgress<=fTotalProgress);
    	m_fLastProgress=fTotalProgress;
    #endif
        char cstrLoading[512];
        sprintf( cstrLoading, "%d%%", (int) floor(fTotalProgress * 100.f + 0.5));
    
    	ZGetInitialLoading()->SetLoadingStr( cstrLoading );
    	ZGetInitialLoading()->SetPercentage( fTotalProgress * 100.f );
    	ZGetInitialLoading()->Draw( MODE_DEFAULT, 0 , true );
    }
    so just load percentage would come but not the text .... I want to leave the two ....


    How I can do?


  2. #2
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: As a percentage placing in the load bar

    Main.cpp:
    Code:
    	ZGetFlashBangEffect()->SetDrawCopyScreen(true);
    	static const char *szDone = "100%";
    	ZGetInitialLoading()->SetLoadingStr(szDone);
    	if( ZGetInitialLoading()->IsUseEnable() )

  3. #3
    Member Slime is offline
    MemberRank
    Jul 2011 Join Date
    HenesysLocation
    79Posts

    Re: As a percentage placing in the load bar

    ZInitialLoading.cpp
    Code:
    		// 로딩 이름
    		if(m_pLoadingStr && mpDC ) {
    			char buffer[256];
    			sprintf(buffer,"%s",m_pLoadingStr);
    			int nWidth = mpDC->m_Font.GetTextWidth(buffer);
    			int x = (int)(RGetScreenWidth() * 0.5) - nWidth/2;
    			int y = (int)(RGetScreenHeight() * 0.927f);
    			mpDC->m_Font.DrawText( x, y, buffer, 0xFF00FFFF );
    		}
    Code:
    void ZLoadingProgress::Draw() 
    {
        float fTotalProgress = m_fTotalProgressStart + m_fThisAmount * m_fCurrentProgress;
    #ifdef _DEBUG // 혹시 되돌아가는경우인지 체크
    	_ASSERT(m_fLastProgress<=fTotalProgress);
    	m_fLastProgress=fTotalProgress;
    #endif
    	char cstrLoading[512];
    	sprintf( cstrLoading, "%d%%", (int) floor(fTotalProgress * 100.f + 0.5));
    
    	ZGetInitialLoading()->SetLoadingStr( cstrLoading );
    	ZGetInitialLoading()->SetPercentage( fTotalProgress * 100.f );
    	ZGetInitialLoading()->Draw( MODE_DEFAULT, 0 , true );
    }
    main.cpp
    Code:
    	if( ZGetInitialLoading()->IsUseEnable() )
    	{
    		ZGetInitialLoading()->AddBitmap( 0, "Interface/Default/LOADING/Gunz2_BackGround.tga" );
    		ZGetInitialLoading()->AddBitmapBar( "Interface/Default/LOADING/Gunz2_Bar.tga" );
    //		ZGetInitialLoading()->AddBitmapBar1( "Interface/Default/LOADING/loading.bmp" );
    		ZGetInitialLoading()->SetText( g_pDefFont, 10, 30, cstrReleaseDate );
    		ZGetInitialLoading()->SetPercentage( 0.0f  );
    		ZGetInitialLoading()->Draw( MODE_FADEIN, 0 , true );
    	}



Advertisement