本文整理汇总了C++中CUIStatic::SetOriginalRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CUIStatic::SetOriginalRect方法的具体用法?C++ CUIStatic::SetOriginalRect怎么用?C++ CUIStatic::SetOriginalRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUIStatic
的用法示例。
在下文中一共展示了CUIStatic::SetOriginalRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: init_addon
CUIStatic* init_addon(
CUIWeaponCellItem *cell_item,
LPCSTR sect,
float scale,
float scale_x,
eAddonType idx)
{
CUIStatic *addon = xr_new<CUIStatic>();
addon->SetAutoDelete(true);
auto pos = cell_item->get_addon_offset(idx); pos.x *= scale*scale_x; pos.y *= scale;
auto width = (float)pSettings->r_u32(sect, "inv_grid_width")*INV_GRID_WIDTH;
auto height = (float)pSettings->r_u32(sect, "inv_grid_height")*INV_GRID_HEIGHT;
auto tex_x = (float)pSettings->r_u32(sect, "inv_grid_x")*INV_GRID_WIDTH;
auto tex_y = (float)pSettings->r_u32(sect, "inv_grid_y")*INV_GRID_HEIGHT;
addon->SetStretchTexture (true);
addon->InitTexture ("ui\\ui_icon_equipment");
addon->SetOriginalRect (tex_x, tex_y, width, height);
addon->SetWndRect (pos.x, pos.y, width*scale*scale_x, height*scale);
addon->SetColor (color_rgba(255,255,255,192));
return addon;
}