本文整理汇总了C++中MyMatrix::SetTranslation方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMatrix::SetTranslation方法的具体用法?C++ MyMatrix::SetTranslation怎么用?C++ MyMatrix::SetTranslation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyMatrix
的用法示例。
在下文中一共展示了MyMatrix::SetTranslation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void MenuSlider::Draw(MyMatrix* pMatProj, MyMatrix* pMatView)
{
float centerx = m_PosX;
float top = m_PosY;
// TODO: take more justifications and vertical/horizontal into account for top and left.
// should ideally be done once instead of every frame.
//if( m_Justification & Justify_Left )
//{
// centerx += m_BarThickness/2;
//}
float emptypos = (m_PosY - m_VisualRange);
MyAssert( m_pSprite );
//m_pSprite = g_pGame->m_pResources->m_pSprites[SL_WhiteSquareResizable];
if( m_pSprite )
{
BufferManager* pBufferManager = m_pGameCore->GetManagers()->GetBufferManager();
m_pSprite->Create( pBufferManager, "MenuSlider", m_BarThickness, m_VisualRange, 0, 1, 0, 1, Justify_CenterX|Justify_Top );
MyMatrix world;
world.SetIdentity();
world.SetTranslation( centerx, top, 0 );
//FIX m_pSprite->SetTint( m_Colors[MSCT_BarColor] );
m_pSprite->Draw( pMatProj, pMatView, &world ); //&g_pGame->m_OrthoMatrix );
m_pSprite->Create( pBufferManager, "MenuSlider", m_HandleWidth, m_HandleHeight, 0, 1, 0, 1, Justify_CenterX|Justify_Top );
world.SetTranslation( centerx, emptypos + m_ValuePerc*m_VisualRange, 0 );
//FIX m_pSprite->SetTint( m_Colors[MSCT_HandleColor] );
m_pSprite->Draw( pMatProj, pMatView, &world ); //&g_pGame->m_OrthoMatrix );
}
}