本文整理汇总了C++中SetAlpha函数的典型用法代码示例。如果您正苦于以下问题:C++ SetAlpha函数的具体用法?C++ SetAlpha怎么用?C++ SetAlpha使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetAlpha函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetDisplayValue
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CHudMoneyClassic::OnThink(void)
{
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
if (pPlayer)
{
m_iMoney = pPlayer->GetMoney();
SetDisplayValue(m_iMoney);
}
if (g_fr_classic.GetBool())
{
if (g_fr_economy.GetBool())
{
SetAlpha(255);
}
else
{
SetAlpha(0);
}
}
else
{
SetAlpha(0);
}
}
示例2: float
//-----------------------------------------------------------------------------
//! change alpha for each pixmap as they become enabled/ disabled.
//-----------------------------------------------------------------------------
void tThrusterPopup::UpdatePixmaps()
{
float percent = ( (float)m_Step / 100.0F );
float minAlpha = tSystemSettings::Instance()->NightMode() ? 40.0F : 100.0F;
int alphaOn = static_cast<int> ( minAlpha + ( percent * (255.0F - minAlpha ) ) );
percent = (100.0F - float(m_Step)) / 100.0F;
int alphaOff = static_cast<int> ( minAlpha + ( percent * (255.0F - minAlpha ) ) );
QPixmap pixmapOn = ( tSystemSettings::Instance()->NightMode() ?
tPath::ResourceFile( "medusa/icons/thruster_night.png" ) :
tPath::ResourceFile( "medusa/icons/thruster_day.png" ) );
QPixmap pixmapOff = ( tSystemSettings::Instance()->NightMode() ?
tPath::ResourceFile( "medusa/icons/thruster_night_off.png" ) :
tPath::ResourceFile( "medusa/icons/thruster_day_off.png" ) );
SetAlpha( pixmapOn, alphaOn );
SetAlpha( pixmapOff, alphaOff );
m_pThrusterOn->setPixmap( pixmapOn );
m_pThrusterOff->setPixmap( pixmapOff );
update();
}
示例3: SetAlpha
// If we've just taken damage, deal with the invincibility animation
void Player::HandleInvincibility(const jutil::GameTime& timespan)
{
m_TimerInvincibility += timespan;
// Flash the player sprite
if (m_TimerInvincibility.ElapsedMilliseconds() % 4 == 0)
SetAlpha(1.f);
else
SetAlpha(0.f);
// If just been hit, apply a force to the player
if (m_TimerInvincibility.ElapsedMilliseconds() < INVINCIBILITY_TIME*0.2f)
{
jmath::vec3 f;
GetRigidBody()->ClearVelocity();
if (m_TimerInvincibility.ElapsedMilliseconds() < 70)
f.y = -0.6;
if (m_TimerInvincibility.ElapsedMilliseconds() < 70)
f.x = -0.3;
if (m_Direction == Mega::Direction::LEFT)
f.x = -f.x;
GetRigidBody()->ApplyForce(f);
m_PlayerState = TAKING_DAMAGE;
}
else
m_PlayerState = UNKNOWN;
}
示例4: SetAlpha
void CGUIResizeControl::Render()
{
if (HasFocus())
{
DWORD dwAlphaCounter = m_dwFrameCounter + 2;
DWORD dwAlphaChannel;
if ((dwAlphaCounter % 128) >= 64)
dwAlphaChannel = dwAlphaCounter % 64;
else
dwAlphaChannel = 63 - (dwAlphaCounter % 64);
dwAlphaChannel += 192;
SetAlpha( (unsigned char)dwAlphaChannel );
m_imgFocus.SetVisible(true);
m_imgNoFocus.SetVisible(false);
m_dwFrameCounter++;
}
else
{
SetAlpha(0xff);
m_imgFocus.SetVisible(false);
m_imgNoFocus.SetVisible(true);
}
// render both so the visibility settings cause the frame counter to resetcorrectly
m_imgFocus.Render();
m_imgNoFocus.Render();
CGUIControl::Render();
}
示例5: SetAlpha
STDMETHODIMP CGfxSAMSUNG::Update()
{
if(m_bShow)
SetAlpha(MAX_ALPHA_VAL);
else
SetAlpha(MIN_ALPHA_VAL);
return S_OK;
}
示例6: SetAlpha
void GuiInfomsg::Update(GuiTrigger * t)
{
if(GetAlpha() == 0){
return;
}
if(difftime(time(NULL), timer) >= 2.0f){
SetAlpha(GetAlpha()-10);
if(GetAlpha() < 0){ SetAlpha(0); }
}
}
示例7: rand
void CAsteroid::Respawn()
{
int stochast = rand()%100;
int sum = 0;
bool isRepossed = false;
CODEManager* ode = CODEManager::Instance();
for(unsigned int i = 0; i < ode->m_pUniverse->m_vRespawnAreas.size(); i++)
{
if(isRepossed) continue;
sum += ode->m_pUniverse->m_vRespawnAreas[i].chance;
if(stochast < sum) { ReposAtArea(ode->m_pUniverse->m_vRespawnAreas[i]); isRepossed = true; }
}
if(!isRepossed) ReposAtOrbit();
Vector n;
m_oPhysicsData.m_pOwner->SetLinVelocity(n);
m_oPhysicsData.m_pOwner->SetAngVelocity(n);
SetForce(n);
m_fThrowTime = 0;
m_fTemperatureTime = 0.0f;
m_iMilliSecsInOrbit = 0;
m_iWallBounces = 0;
m_pHoldingPlayer = NULL;
m_pThrowingPlayer = NULL;
SetDepth(-1.0);
SetAlpha(1.0);
}
示例8: AddChild
void PauseMenu::DoGameOver()
{
state = GAME_OVER;
auto global = Global::GetInstance();
black = Ptr<Sprite>::New();
black->SetTexture(global->texBlack);
black->SetPosition(Vector3f(192, 224, 10));
black->SetAlpha(0);
black->AddTween(Ptr<FadeTo>::New(0.75f, FADE_TIME, Tweener::EASE_OUT).Get());
AddChild(black.Get());
title = Ptr<PauseMenuItem>::New(PauseMenuItem::GAME_OVER);
title->SetPosition(Vector3f(-140, 440, 5));
title->SetAlpha(0);
title->AddTween(Ptr<MoveBy>::New(Vector3f(140, -235, 0), FADE_TIME, Tweener::EASE_OUT).Get());
title->AddTween(Ptr<FadeTo>::New(1.0f, FADE_TIME, Tweener::EASE_OUT).Get());
AddChild(title.Get());
AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::CONTINUE).Get());
AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::RETURN_TO_TITLE).Get());
AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::SAVE_REPLAY).Get());
AddMenuItem(Ptr<PauseMenuItem>::New(PauseMenuItem::RETRY).Get());
for (int i = 0; i < GetItemCount(); i++)
{
auto menuItem = GetMenuItem(i);
menuItem->SetPosition(Vector3f(-140, 440, 5));
menuItem->SetAlpha(0);
menuItem->AddTween(Ptr<MoveBy>::New(Vector3f(150, -285 - 32 * i, 0), FADE_TIME, Tweener::EASE_OUT).Get());
menuItem->AddTween(Ptr<FadeTo>::New(1.0f, FADE_TIME, Tweener::EASE_OUT).Get());
}
EventSystem::GetInstance()->RegisterKeyDownListener(this);
}
示例9: SetProfileProfileAlphabet
void SetProfileProfileAlphabet(MSA &msa1, MSA &msa2)
{
ALPHA Alpha = ALPHA_Undefined;
switch (g_SeqType.get())
{
case SEQTYPE_Auto:
Alpha = msa1.GuessAlpha();
break;
case SEQTYPE_Protein:
Alpha = ALPHA_Amino;
break;
case SEQTYPE_DNA:
Alpha = ALPHA_DNA;
break;
case SEQTYPE_RNA:
Alpha = ALPHA_RNA;
break;
default:
Quit("Invalid SeqType");
}
SetAlpha(Alpha);
msa1.FixAlpha();
msa2.FixAlpha();
if (ALPHA_DNA == Alpha || ALPHA_RNA == Alpha)
SetPPScore(PPSCORE_SPN);
}
示例10: SetScale
void CHUDMessage::Update()
{
// Sanity checks...
if (!IsVisible()) return;
if (m_fScale != g_pInterfaceResMgr->GetXRatio())
SetScale(g_pInterfaceResMgr->GetXRatio());
if (m_fInitTime < 0.0f)
m_fInitTime = g_pLTClient->GetTime();
if (m_fDuration > 0.0f)
{
float fTime = GetLifetime();
if (fTime > m_fDuration)
{
fTime -= m_fDuration;
float fAlpha = 1.0f - (fTime / m_fFadeDur);
if (fAlpha <= 0.0f)
{
Show(LTFALSE);
return;
}
else
SetAlpha(fAlpha);
}
}
else
Show(LTFALSE);
}
示例11: HandleDeath
void Player::Update(const jutil::GameTime& timespan)
{
if (m_Health <= 0)
{
HandleDeath(timespan);
return;
}
if (m_TimerInvincibility.ElapsedMilliseconds() < INVINCIBILITY_TIME)
{
HandleInvincibility(timespan);
}
else
{
SetAlpha(1.f);
m_PlayerState = UNKNOWN;
}
HandleLevelCollisionResolution(timespan);
// Jumping controls
if (m_PlayerState != TAKING_DAMAGE)
{
HandleControls(timespan);
}
HandleBullets(timespan);
SetAnimationFrame();
}
示例12: SetColorChanged
void PixelShaderManager::Dirty()
{
s_bFogRangeAdjustChanged = true;
s_bViewPortChanged = true;
nLightsChanged[0] = 0; nLightsChanged[1] = 0x80;
SetColorChanged(0, 0);
SetColorChanged(0, 1);
SetColorChanged(0, 2);
SetColorChanged(0, 3);
SetColorChanged(1, 0);
SetColorChanged(1, 1);
SetColorChanged(1, 2);
SetColorChanged(1, 3);
SetAlpha();
SetDestAlpha();
SetZTextureBias();
SetViewportChanged();
SetIndTexScaleChanged(false);
SetIndTexScaleChanged(true);
SetIndMatrixChanged(0);
SetIndMatrixChanged(1);
SetIndMatrixChanged(2);
SetZTextureTypeChanged();
SetTexCoordChanged(0);
SetTexCoordChanged(1);
SetTexCoordChanged(2);
SetTexCoordChanged(3);
SetTexCoordChanged(4);
SetTexCoordChanged(5);
SetTexCoordChanged(6);
SetTexCoordChanged(7);
SetFogColorChanged();
SetFogParamChanged();
}
示例13: SetVisible
void CNB_Vote_Panel::UpdateVisibility()
{
if ( m_VotePanelStatus == VPS_NONE )
{
SetVisible( false );
return;
}
if ( !IsVisible() )
{
const float flTransitionTime = 0.3f;
int target_x = ( ScreenWidth() * 0.5f ) + YRES( 100 );
int y = YRES( 320 );
if ( m_VotePanelType == VPT_INGAME )
{
target_x = ScreenWidth() - YRES( 180 );
y = YRES( 260 );
}
SetPos( target_x + YRES( 100 ), y );
vgui::GetAnimationController()->RunAnimationCommand( this, "xpos", target_x, 0, flTransitionTime, vgui::AnimationController::INTERPOLATOR_DEACCEL );
SetAlpha( 1 );
vgui::GetAnimationController()->RunAnimationCommand( this, "Alpha", 255, 0, flTransitionTime, vgui::AnimationController::INTERPOLATOR_LINEAR );
}
SetVisible( true );
}
示例14: SetScheme
CampaignFrame::CampaignFrame(Panel *parent, const char *panelName, bool showTaskbarIcon) :
vgui::Frame(parent, panelName, showTaskbarIcon)
{
vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/SwarmSchemeNew.res", "SwarmSchemeNew");
SetScheme(scheme);
SetSize( ScreenWidth() + 1, ScreenHeight() + 1 );
SetTitle("Campaign", true );
SetPos(0,0);
SetMoveable(false);
SetSizeable(false);
SetMenuButtonVisible(false);
SetMaximizeButtonVisible(false);
SetMinimizeToSysTrayButtonVisible(false);
SetCloseButtonVisible(false);
SetTitleBarVisible(false);
SetAlpha(0.3f);
SetPaintBackgroundEnabled(false);
m_pCampaignPanel = new CampaignPanel( this, "CampaignPanel" );
RequestFocus();
SetVisible(true);
SetEnabled(true);
SetKeyBoardInputEnabled(false);
if (GetClientModeASW() && GetClientModeASW()->m_bSpectator)
{
engine->ServerCmd("cl_spectating");
}
}
示例15: switch
int TBackgroundVuMeter::SetParameterValue(int nInd, std::string csNew)
{
int nErr = 0;
int nNb;
nNb = TBackground::GetParameterCount();
if(nInd >= nNb)
{
nInd -= nNb;
switch(nInd)
{
case 0 : SetBinSize(atoi(csNew.c_str())); break;
case 1 : SetAlpha(atof(csNew.c_str())); break;
case 2 : SetThreshold(atof(csNew.c_str())); break;
default : nErr = 1;
}
}
else
nErr = TBackground::SetParameterValue(nInd, csNew);
return nErr;
}