本文整理汇总了C++中CColor::SetState方法的典型用法代码示例。如果您正苦于以下问题:C++ CColor::SetState方法的具体用法?C++ CColor::SetState怎么用?C++ CColor::SetState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CColor
的用法示例。
在下文中一共展示了CColor::SetState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateInterface
void CScreenApperance::CreateInterface()
{
CWindow* pw;
CLabel* pl;
CButton* pb;
CColor* pco;
CSlider* psl;
Math::Point pos, ddim;
std::string name;
pos.x = 0.10f;
pos.y = 0.10f;
ddim.x = 0.80f;
ddim.y = 0.80f;
pw = m_interface->CreateWindows(pos, ddim, 12, EVENT_WINDOW5);
GetResource(RES_TEXT, RT_TITLE_PERSO, name);
pw->SetName(name);
pos.x = 0.10f;
pos.y = 0.40f;
ddim.x = 0.50f;
ddim.y = 0.50f;
pw->CreateGroup(pos, ddim, 5, EVENT_INTERFACE_GLINTl); // orange corner
pos.x = 0.40f;
pos.y = 0.10f;
ddim.x = 0.50f;
ddim.y = 0.50f;
pw->CreateGroup(pos, ddim, 4, EVENT_INTERFACE_GLINTr); // blue corner
pos.x = 95.0f/640.0f;
pos.y = 108.0f/480.0f;
ddim.x = 220.0f/640.0f;
ddim.y = 274.0f/480.0f;
pw->CreateGroup(pos, ddim, 17, EVENT_NULL); // frame
pos.x = 100.0f/640.0f;
pos.y = 364.0f/480.0f;
ddim.x = 210.0f/640.0f;
ddim.y = 14.0f/480.0f;
pw->CreateGroup(pos, ddim, 3, EVENT_NULL); // transparent -> gray
pos.x = 120.0f/640.0f;
pos.y = 364.0f/480.0f;
ddim.x = 80.0f/640.0f;
ddim.y = 28.0f/480.0f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_PHEAD);
pb->SetState(STATE_SHADOW);
pb->SetState(STATE_CARD);
pos.x = 210.0f/640.0f;
pos.y = 364.0f/480.0f;
ddim.x = 80.0f/640.0f;
ddim.y = 28.0f/480.0f;
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_PBODY);
pb->SetState(STATE_SHADOW);
pb->SetState(STATE_CARD);
pos.x = 100.0f/640.0f;
pos.y = 354.0f/480.0f;
ddim.x = 210.0f/640.0f;
ddim.y = 10.0f/480.0f;
pw->CreateGroup(pos, ddim, 1, EVENT_INTERFACE_GLINTb); // orange bar
pos.x = 100.0f/640.0f;
pos.y = 154.0f/480.0f;
ddim.x = 210.0f/640.0f;
ddim.y = 200.0f/480.0f;
pw->CreateGroup(pos, ddim, 2, EVENT_INTERFACE_GLINTu); // orange -> transparent
// Face
pos.x = 340.0f/640.0f;
pos.y = 356.0f/480.0f;
ddim.x = 200.0f/640.0f;
ddim.y = 16.0f/480.0f;
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL11, "");
pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
pos.x = 340.0f/640.0f;
pos.y = 312.0f/480.0f;
ddim.x = 44.0f/640.0f;
ddim.y = 44.0f/480.0f;
pb = pw->CreateButton(pos, ddim, 43, EVENT_INTERFACE_PFACE1);
pb->SetState(STATE_SHADOW);
pos.x += 50.0f/640.0f;
pb = pw->CreateButton(pos, ddim, 46, EVENT_INTERFACE_PFACE4);
pb->SetState(STATE_SHADOW);
pos.x += 50.0f/640.0f;
pb = pw->CreateButton(pos, ddim, 45, EVENT_INTERFACE_PFACE3);
pb->SetState(STATE_SHADOW);
pos.x += 50.0f/640.0f;
pb = pw->CreateButton(pos, ddim, 44, EVENT_INTERFACE_PFACE2);
pb->SetState(STATE_SHADOW);
// Glasses
pos.x = 340.0f/640.0f;
pos.y = 270.0f/480.0f;
ddim.x = 200.0f/640.0f;
ddim.y = 16.0f/480.0f;
pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL12, "");
pl->SetTextAlign(Gfx::TEXT_ALIGN_LEFT);
//.........这里部分代码省略.........
示例2: UpdatePerso
void CScreenApperance::UpdatePerso()
{
CWindow* pw;
CLabel* pl;
CButton* pb;
CColor* pc;
CSlider* ps;
Gfx::Color color;
std::string name;
int i;
PlayerApperance& apperance = m_main->GetPlayerProfile()->GetApperance();
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if ( pw == nullptr ) return;
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PHEAD));
if ( pb != nullptr )
{
pb->SetState(STATE_CHECK, m_apperanceTab==0);
}
pb = static_cast<CButton*>(pw->SearchControl(EVENT_INTERFACE_PBODY));
if ( pb != nullptr )
{
pb->SetState(STATE_CHECK, m_apperanceTab==1);
}
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL11));
if ( pl != nullptr )
{
if ( m_apperanceTab == 0 )
{
pl->SetState(STATE_VISIBLE);
GetResource(RES_TEXT, RT_PERSO_FACE, name);
pl->SetName(name);
}
else
{
pl->ClearState(STATE_VISIBLE);
}
}
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL12));
if ( pl != nullptr )
{
if ( m_apperanceTab == 0 )
{
pl->SetState(STATE_VISIBLE);
GetResource(RES_TEXT, RT_PERSO_GLASSES, name);
pl->SetName(name);
}
else
{
pl->ClearState(STATE_VISIBLE);
}
}
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL13));
if ( pl != nullptr )
{
if ( m_apperanceTab == 0 ) GetResource(RES_TEXT, RT_PERSO_HAIR, name);
else GetResource(RES_TEXT, RT_PERSO_BAND, name);
pl->SetName(name);
}
pl = static_cast<CLabel*>(pw->SearchControl(EVENT_LABEL14));
if ( pl != nullptr )
{
if ( m_apperanceTab == 0 )
{
pl->ClearState(STATE_VISIBLE);
}
else
{
pl->SetState(STATE_VISIBLE);
GetResource(RES_TEXT, RT_PERSO_COMBI, name);
pl->SetName(name);
}
}
for ( i=0 ; i<4 ; i++ )
{
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PFACE1+i)));
if ( pb == nullptr ) break;
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
pb->SetState(STATE_CHECK, i==apperance.face);
}
for ( i=0 ; i<10 ; i++ )
{
pb = static_cast<CButton*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PGLASS0+i)));
if ( pb == nullptr ) break;
pb->SetState(STATE_VISIBLE, m_apperanceTab==0);
pb->SetState(STATE_CHECK, i==apperance.glasses);
}
for ( i=0 ; i<3*3 ; i++ )
{
pc = static_cast<CColor*>(pw->SearchControl(static_cast<EventType>(EVENT_INTERFACE_PC0a+i)));
if ( pc == nullptr ) break;
//.........这里部分代码省略.........