本文整理汇总了C++中PlayerData::getPercent方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerData::getPercent方法的具体用法?C++ PlayerData::getPercent怎么用?C++ PlayerData::getPercent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerData
的用法示例。
在下文中一共展示了PlayerData::getPercent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void RaceView::draw()
{
if( !bVisible ){
return;
}
if( mBg ){
gl::color(1,1,1);
gl::draw( mBg );
}
gl::drawSolidRect( Rectf( 834, 105, 834+260, 105+185 ) ); // big white rect
gl::drawSolidRect( Rectf( 60, 133, 1870, 135 ) ); // white line
// PLAYER INFO
for( int i=0; i<mModel->getNumRacers(); i++){
PlayerData *pd = Model::getInstance()->playerData[i];
mRaceTexts[i]->draw( pd, Vec2f(0, 390 + 102*i) );
}
// MAIN TIMER
gl::color(0,0,0,1);
if( mStateManager->getCurrentRaceState() == RACE_STATE::RACE_RUNNING ){
int elapsedTime = (getElapsedSeconds()*1000.0) - mModel->startTimeMillis;
mModel->elapsedRaceTimeMillis = elapsedTime;
mTimerFont->drawString( mGlobal->toTimestamp(mModel->elapsedRaceTimeMillis ), Vec2f(867,154) );
}else if( mStateManager->getCurrentRaceState() == RACE_STATE::RACE_COMPLETE ){
mTimerFont->drawString( mGlobal->toTimestamp(mModel->elapsedRaceTimeMillis ), Vec2f(867,154) );
}else {
mTimerFont->drawString( mGlobal->toTimestamp(0), Vec2f(867,154) );
}
// DIAL
gl::color(1,1,1,1);
gl::draw( mDial, mDial->getSize() * -0.5 + Vec2f(967, 580) );
// FLAG
gl::color(1,1,1,1);
if( mFinishFlag && mGlobal->currentRaceType == RACE_TYPE::RACE_TYPE_TIME ){
gl::draw(mFinishFlag, Vec2f(873, 130));
}
mStartStop.draw();
if( mLogo ){
gl::color( 1, 1, 1, 1 );
gl::draw( mLogo, Vec2f(1920, 1080) - Vec2f(50,50) - mLogo->getSize() );
}
ci::ColorA tmpCol;
for( int i=0; i<mModel->getNumRacers(); i++){
PlayerData *pd = Model::getInstance()->playerData[i];
mProgressShader->bind();{
tmpCol = mGlobal->playerColors[i];
mProgressShader->uniform( "baseColor", tmpCol );
mProgressShader->uniform( "leadingEdgePct", (float)pd->getPercent() );
mProgressShader->uniform( "trailingEdgePct", (float)pd->getPercent() - 0.15f );
gl::draw( mVboList[i] );
}mProgressShader->unbind();
}
// COUNTDOWN
mCountDown->draw();
}