本文整理汇总了C++中CUIStatic::SetShader方法的典型用法代码示例。如果您正苦于以下问题:C++ CUIStatic::SetShader方法的具体用法?C++ CUIStatic::SetShader怎么用?C++ CUIStatic::SetShader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUIStatic
的用法示例。
在下文中一共展示了CUIStatic::SetShader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateDragItem
CUIDragItem* CUIWeaponCellItem::CreateDragItem()
{
CUIDragItem* i = inherited::CreateDragItem();
CUIStatic* s = NULL;
if(GetIcon(eSilencer))
{
s = new CUIStatic(); s->SetAutoDelete(true);
s->SetShader (InventoryUtilities::GetEquipmentIconsShader());
InitAddon (s, *object()->GetSilencerName(), m_addon_offset[eSilencer], false);
s->SetColor (i->wnd()->GetColor());
i->wnd ()->AttachChild (s);
}
if(GetIcon(eScope))
{
s = new CUIStatic(); s->SetAutoDelete(true);
s->SetShader (InventoryUtilities::GetEquipmentIconsShader());
InitAddon (s, *object()->GetScopeName(), m_addon_offset[eScope], false);
s->SetColor (i->wnd()->GetColor());
i->wnd ()->AttachChild (s);
}
if(GetIcon(eLauncher))
{
s = new CUIStatic(); s->SetAutoDelete(true);
s->SetShader (InventoryUtilities::GetEquipmentIconsShader());
InitAddon (s, *object()->GetGrenadeLauncherName(),m_addon_offset[eLauncher], false);
s->SetColor (i->wnd()->GetColor());
i->wnd ()->AttachChild (s);
}
return i;
}
示例2: InitIcon
float CUIPdaKillMessage::InitIcon(CUIStatic& refStatic, float x, IconInfo& info){
if ( 0 == info.m_rect.width())
return 0;
if (info.m_shader == NULL)
return 0;
float y = 0;
float selfHeight = GetHeight();
float scale = 0;
Frect rect = info.m_rect;
float width = rect.width();
float height = rect.height();
scale = selfHeight/height;
if (scale > 1)
scale = 1;
width = width*scale;
height = height*scale;
y = (selfHeight - height) /2;
refStatic.Init(x, y, width, height);
refStatic.SetOriginalRect(info.m_rect);
refStatic.SetShader(info.m_shader);
refStatic.SetStretchTexture(true);
return width;
}
示例3: LoadItemTexture
void CUIDragDropReferenceList::LoadItemTexture(LPCSTR section, Ivector2 cell_pos)
{
CUIStatic* ref = m_references[cell_pos.x];
ref->SetShader(InventoryUtilities::GetEquipmentIconsShader());
Frect texture_rect;
texture_rect.x1 = pSettings->r_float(section, "inv_grid_x") *INV_GRID_WIDTH;
texture_rect.y1 = pSettings->r_float(section, "inv_grid_y") *INV_GRID_HEIGHT;
texture_rect.x2 = pSettings->r_float(section, "inv_grid_width") *INV_GRID_WIDTH;
texture_rect.y2 = pSettings->r_float(section, "inv_grid_height")*INV_GRID_HEIGHT;
texture_rect.rb.add(texture_rect.lt);
ref->SetTextureRect(texture_rect);
ref->TextureOn();
ref->SetTextureColor(color_rgba(255,255,255,255));
ref->SetStretchTexture(true);
}
示例4: SetItem
void CUIDragDropReferenceList::SetItem(CUICellItem* itm, Ivector2 cell_pos)
{
CUIStatic* ref = m_references[cell_pos.x];
ref->SetShader(itm->GetShader());
ref->SetTextureRect(itm->GetTextureRect());
ref->TextureOn();
ref->SetTextureColor(color_rgba(255,255,255,255));
ref->SetStretchTexture(true);
CUICell& C = m_container->GetCellAt(cell_pos);
if(C.m_item!=itm)
{
m_container->PlaceItemAtPos(itm, cell_pos);
itm->SetWindowName("cell_item");
Register(itm);
itm->SetOwnerList(this);
}
}