本文整理汇总了C++中CAniSequencer::SetID方法的典型用法代码示例。如果您正苦于以下问题:C++ CAniSequencer::SetID方法的具体用法?C++ CAniSequencer::SetID怎么用?C++ CAniSequencer::SetID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAniSequencer
的用法示例。
在下文中一共展示了CAniSequencer::SetID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAccountControls
void CTranscendenceWnd::SetAccountControls (const CMultiverseModel &Multiverse)
// SetAccountControls
//
// Sets the user account controls
{
const CVisualPalette &VI = g_pHI->GetVisuals();
const CG16bitFont &MediumFont = VI.GetFont(fontMedium);
const CG16bitFont &SubTitleFont = VI.GetFont(fontSubTitle);
// Get the account state
CString sUsername;
CString sStatus;
CMultiverseModel::EOnlineStates iState = Multiverse.GetOnlineState(&sUsername, &sStatus);
CG32bitPixel rgbUsernameColor = VI.GetColor(colorTextDialogLabel);
// Metrics
int cxText = Max(SubTitleFont.MeasureText(sUsername), MediumFont.MeasureText(sStatus));
// Compute metrics
RECT rcRect;
VI.GetWidescreenRect(&rcRect);
// Delete any existing controls
m_Reanimator.DeleteElement(ID_ACCOUNT_CONTROLS);
// Create a sequencer to hold all the controls. We will be a child of the
// player bar animation, so we are relative to that.
CAniSequencer *pRoot;
CAniSequencer::Create(CVector(0, 0), &pRoot);
pRoot->SetID(ID_ACCOUNT_CONTROLS);
// The user icon is centered
CAniRoundedRect *pIcon = new CAniRoundedRect;
pIcon->SetPropertyVector(PROP_POSITION, CVector(0, (TITLE_BAR_HEIGHT - ICON_HEIGHT) / 2));
pIcon->SetPropertyVector(PROP_SCALE, CVector(ICON_HEIGHT, ICON_WIDTH));
pIcon->SetPropertyColor(PROP_COLOR, CG32bitPixel(128, 128, 128));
pIcon->SetPropertyOpacity(PROP_OPACITY, 255);
pIcon->SetPropertyInteger(PROP_UL_RADIUS, ICON_CORNER_RADIUS);
pIcon->SetPropertyInteger(PROP_UR_RADIUS, ICON_CORNER_RADIUS);
pIcon->SetPropertyInteger(PROP_LL_RADIUS, ICON_CORNER_RADIUS);
pIcon->SetPropertyInteger(PROP_LR_RADIUS, ICON_CORNER_RADIUS);
pRoot->AddTrack(pIcon, 0);
// The user name baseline is centered.
int y = (TITLE_BAR_HEIGHT / 2) - SubTitleFont.GetAscent();
// Create a hot spot over the entire text region (so that the user can
// click on the username to sign in).
if (iState == CMultiverseModel::stateNoUser || iState == CMultiverseModel::stateOffline)
{
IAnimatron *pButton;
VI.CreateHiddenButton(pRoot, CMD_ACCOUNT,
ICON_WIDTH + (PADDING_LEFT / 2),
y - (PADDING_LEFT / 2),
cxText + PADDING_LEFT,
SubTitleFont.GetHeight() + 2 * MediumFont.GetHeight() + PADDING_LEFT,
0,
&pButton);
pButton->AddListener(EVENT_ON_CLICK, m_pIntroSession, CMD_ACCOUNT);
}
// Username
IAnimatron *pName = new CAniText;
pName->SetPropertyVector(PROP_POSITION, CVector(ICON_WIDTH + PADDING_LEFT, y));
pName->SetPropertyVector(PROP_SCALE, CVector(RectWidth(rcRect), RectHeight(rcRect)));
pName->SetPropertyColor(PROP_COLOR, rgbUsernameColor);
pName->SetPropertyFont(PROP_FONT, &SubTitleFont);
pName->SetPropertyString(PROP_TEXT, sUsername);
pRoot->AddTrack(pName, 0);
y += SubTitleFont.GetHeight();
// Status
IAnimatron *pStatus = new CAniText;
pStatus->SetPropertyVector(PROP_POSITION, CVector(ICON_WIDTH + PADDING_LEFT, y));
pStatus->SetPropertyVector(PROP_SCALE, CVector(RectWidth(rcRect), RectHeight(rcRect)));
pStatus->SetPropertyColor(PROP_COLOR, VI.GetColor(colorTextDialogLabel));
pStatus->SetPropertyFont(PROP_FONT, &MediumFont);
pStatus->SetPropertyString(PROP_TEXT, sStatus);
pRoot->AddTrack(pStatus, 0);
y += MediumFont.GetHeight();
// If the user is signed in, add buttons to edit account and sign out.
#ifndef STEAM_BUILD
if (iState == CMultiverseModel::stateOnline)
//.........这里部分代码省略.........
示例2: SetShipClass
void CNewGameSession::SetShipClass (CShipClass *pClass, int x, int y, int cxWidth)
// SetShipClass
//
// Sets the ship class
{
int i;
const CPlayerSettings *pPlayerSettings = pClass->GetPlayerSettings();
const CVisualPalette &VI = m_HI.GetVisuals();
const CG16bitFont &MediumBoldFont = VI.GetFont(fontMediumBold);
const CG16bitFont &SubTitleFont = VI.GetFont(fontSubTitle);
// Ship class name
SetShipClassName(pClass->GetName(), x, y, cxWidth);
SetShipClassDesc(pPlayerSettings->GetDesc(), x, y, cxWidth);
// Offset
int yOffset = SMALL_BUTTON_HEIGHT + SMALL_SPACING_VERT + MediumBoldFont.GetHeight() + 2 * SubTitleFont.GetHeight();
// Ship class image
SetShipClassImage(pClass, x, y + yOffset, cxWidth);
// Delete previous info
DeleteElement(ID_SHIP_CLASS_INFO);
// Create a sequencer for all class info components
CAniSequencer *pClassInfo;
CAniSequencer::Create(CVector(x, y + yOffset + SubTitleFont.GetHeight()), &pClassInfo);
pClassInfo->SetID(ID_SHIP_CLASS_INFO);
// Generate default devices for the ship class
CDeviceDescList Devices;
pClass->GenerateDevices(1, Devices);
// Generate list of all weapons, sorted by level and name
TSortMap<CString, CItem> RightSide;
for (i = 0; i < Devices.GetCount(); i++)
{
CDeviceClass *pDevice = Devices.GetDeviceClass(i);
if (pDevice->GetCategory() == itemcatWeapon ||
pDevice->GetCategory() == itemcatLauncher)
RightSide.Insert(strPatternSubst(CONSTLIT("%02d_%02d_%s"), 1, pDevice->GetLevel(), pDevice->GetName()), CItem(pDevice->GetItemType(), 1));
}
// Add shields
TSortMap<CString, CItem> LeftSide;
CDeviceClass *pShields = Devices.GetNamedDevice(devShields);
if (pShields)
RightSide.Insert(strPatternSubst(CONSTLIT("%02d_%02d_%s"), 2, pShields->GetLevel(), pShields->GetName()), CItem(pShields->GetItemType(), 1));
// Add armor
RightSide.Insert(CONSTLIT("03"), CItem(g_pUniverse->GetItemType(0), SPECIAL_ARMOR));
// Add reactor
LeftSide.Insert(CONSTLIT("01"), CItem(g_pUniverse->GetItemType(0), SPECIAL_REACTOR));
// Add engines
LeftSide.Insert(CONSTLIT("02"), CItem(g_pUniverse->GetItemType(0), SPECIAL_DRIVE));
// Add cargo
LeftSide.Insert(CONSTLIT("03"), CItem(g_pUniverse->GetItemType(0), SPECIAL_CARGO));
// Add misc devices
for (i = 0; i < Devices.GetCount(); i++)
{
CDeviceClass *pDevice = Devices.GetDeviceClass(i);
if (pDevice->GetCategory() == itemcatMiscDevice)
LeftSide.Insert(strPatternSubst(CONSTLIT("%02d_%02d_%s"), 4, pDevice->GetLevel(), pDevice->GetName()), CItem(pDevice->GetItemType(), 1));
}
// Add device slots
LeftSide.Insert(CONSTLIT("05"), CItem(g_pUniverse->GetItemType(0), SPECIAL_DEVICE_SLOTS));
// Set the ship class info. All weapons go to the right of the ship image
int xPos = (cxWidth / 2) + (SHIP_IMAGE_RECT_WIDTH / 2);
int yPos = 0;
int cxInfo = (cxWidth - xPos);
for (i = 0; i < RightSide.GetCount(); i++)
{
int cyInfo;
IAnimatron *pInfo;
//.........这里部分代码省略.........