本文整理汇总了C++中Panel::GetTall方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::GetTall方法的具体用法?C++ Panel::GetTall怎么用?C++ Panel::GetTall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::GetTall方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnThink
void QuickJoinPanel::OnThink()
{
int iNumItems = MIN( m_FriendInfo.Count(), cl_quick_join_scroll_max.GetInt() );
const int iItemTallMin = 2;
int iItemTall = iItemTallMin;
Panel *pItem = m_GplQuickJoinList->GetPanelItem( 0 );
if ( pItem )
{
iItemTall = pItem->GetTall();
Panel *pItem2 = m_GplQuickJoinList->GetPanelItem( 1 );
if ( pItem2 )
{
int iXPos1, iYPos1;
int iXPos2, iYPos2;
pItem->GetPos( iXPos1, iYPos1 );
pItem2->GetPos( iXPos2, iYPos2 );
iItemTall = iYPos2 - iYPos1;
}
}
iItemTall = MAX( iItemTall, iItemTallMin );
long lRateValue = ( system()->GetTimeMillis() / cl_quick_join_scroll_rate.GetInt() );
int iWrap = ( lRateValue / iItemTall ) + cl_quick_join_scroll_max.GetInt();
if ( iWrap != m_iPrevWrap )
{
RefreshContents( iWrap );
m_iPrevWrap = iWrap;
UpdateNumGamesFoundLabel();
SetVisible( m_FriendInfo.Count() > 0 );
// Fade out last item completely since we wrapped around and done!
pItem = m_GplQuickJoinList->GetPanelItem( ( iNumItems > 1 ) ? ( iNumItems - 1 ) : ( 1 ) );
if ( pItem )
pItem->SetAlpha( 0.0f );
return;
}
int screenWide, screenTall;
vgui::surface()->GetScreenSize( screenWide, screenTall );
int iYOffset = 110;
if ( IsPC() )
{
iYOffset = 30;
}
bool bScrolling = ( iNumItems >= cl_quick_join_scroll_start.GetInt() );
int iCurrentX, iCurrentY;
GetPos( iCurrentX, iCurrentY );
iCurrentY = GetSmoothPanelY( iCurrentY, screenTall
- vgui::scheme()->GetProportionalScaledValue( iYOffset )
- MAX( iNumItems, ( bScrolling ) ? ( 2 ) : ( 1 ) ) * iItemTall );
SetPos( iCurrentX, iCurrentY );
if ( iNumItems > cl_quick_join_scroll_start.GetInt() - 1 )
{
// Scrolling list illusion
int iTimeOffset = lRateValue % iItemTall;
float fTimeOffset = iTimeOffset;
m_GplQuickJoinList->GetPos( iCurrentX, iCurrentY );
m_GplQuickJoinList->SetPos( iCurrentX, fTimeOffset + vgui::scheme()->GetProportionalScaledValue( cl_quick_join_scroll_offset.GetFloat() ) );
float fListEdgeAlphas = 255.0f * ( fTimeOffset / static_cast<float>( iItemTall ) );
// Fade in first item
pItem = m_GplQuickJoinList->GetPanelItem( 0 );
if ( pItem )
{
pItem->SetAlpha( fListEdgeAlphas );
}
// Fade out last item
pItem = m_GplQuickJoinList->GetPanelItem( ( iNumItems > 1 ) ? ( iNumItems - 1 ) : ( 1 ) );
if ( pItem )
{
pItem->SetAlpha( 255.0f - fListEdgeAlphas );
}
}
else
{
m_GplQuickJoinList->GetPos( iCurrentX, iCurrentY );
m_GplQuickJoinList->SetPos( iCurrentX, vgui::scheme()->GetProportionalScaledValue( cl_quick_join_scroll_offset.GetFloat() ) );
}
}