本文整理汇总了C++中Panel::AddElement方法的典型用法代码示例。如果您正苦于以下问题:C++ Panel::AddElement方法的具体用法?C++ Panel::AddElement怎么用?C++ Panel::AddElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Panel
的用法示例。
在下文中一共展示了Panel::AddElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetupMenu
void SetupMenu()
{
DebugRenderer* pDebugRenderer = DebugRenderer::GetInstance();
std::cout << "Got debuginst \n";
DrawingAbstractor* pAbstractor = new DrawingAbstractor(pDebugRenderer);
GUIMngr = new GUIManager(pAbstractor);
Panel* pPanel = new Panel("Universal Cheats", "Univ Panel", XMFLOAT2(600.0f, 300.0f), XMFLOAT2(230.0f, 180.0f));
pPanel->AddElement(
new Label("ON", "Aimbot Label", XMFLOAT2(130.0f, 30.0f), XMFLOAT2(20.0f, 20.0f)));
pPanel->AddElement(
new Button("Toggle Aimbot", "Aimbot Btn", XMFLOAT2(10.0f, 30), XMFLOAT2(110.0f, 20.0f),
[&]()->void
{
AimbotEnabled = !AimbotEnabled;
Panel* pTempPanel = GUIMngr->GetElement<Panel>("Univ Panel");
if (pTempPanel != nullptr)
{
Label* pLabel = pTempPanel->GetElement<Label>("Aimbot Label");
if (pLabel != nullptr)
{
if (AimbotEnabled)
pLabel->ChangeText("ON");
else
pLabel->ChangeText("OFF");
}
}
}));
pPanel->AddElement(
new Label("ON", "Recoil Label", XMFLOAT2(130.0f, 55.0f), XMFLOAT2(20.0f, 20.0f)));
pPanel->AddElement(
new Button("Toggle Recoil", "Recoil Btn", XMFLOAT2(10.0f, 55.0f), XMFLOAT2(110.0f, 20.0f),
[&]()->void
{
NoRecoilEnabled = !NoRecoilEnabled;
Panel* pTempPanel = GUIMngr->GetElement<Panel>("Univ Panel");
if (pTempPanel != nullptr)
{
Label* pLabel = pTempPanel->GetElement<Label>("Recoil Label");
if (pLabel != nullptr)
{
if (NoRecoilEnabled)
pLabel->ChangeText("ON");
else
pLabel->ChangeText("OFF");
}
}
}));
pPanel->AddElement(
new Label("Aimbot FOV", "FOV Label", XMFLOAT2(130.0f, 115.0f), XMFLOAT2(20.0f, 20.0f)));
pPanel->AddElement(
new Slider<int>("Fov", XMFLOAT2(20.0f, 115.0f), XMFLOAT2(50.0f, 15.0f), 0, 25, Colors::Black,
[&]()->void
{
Panel* pTempPanel = GUIMngr->GetElement<Panel>("Univ Panel");
if (pTempPanel != nullptr)
{
auto pSlider = pTempPanel->GetElement<Slider<int>>("Fov");
if (pSlider != nullptr)
HackCore.m_FOV = pSlider->GetValue();
}
}));
pPanel->AddElement(
new Label("ON", "ESP Label", XMFLOAT2(130.0f, 80.0f), XMFLOAT2(20.0f, 20.0f)));
pPanel->AddElement(
new Button("Toggle ESP", "ESP Btn", XMFLOAT2(10.0f, 80.0f), XMFLOAT2(110.0f, 20.0f),
[&]()->void
{
EspEnabled = !EspEnabled;
Panel* pTempPanel = GUIMngr->GetElement<Panel>("Univ Panel");
if (pTempPanel != nullptr)
{
Label* pLabel=pTempPanel->GetElement<Label>("ESP Label");
if (pLabel != nullptr)
{
if (EspEnabled)
pLabel->ChangeText("ON");
else
pLabel->ChangeText("OFF");
}
}
}));
pPanel->AddElement(
new Label("3D", "ESP Mode Label", XMFLOAT2(130.0f, 140.0f), XMFLOAT2(20.0f, 20.0f)));
pPanel->AddElement(
new Button("ESP Mode", "ESP Mode Btn", XMFLOAT2(10.0f, 140.0f), XMFLOAT2(110.0f,20.0f),
[&]()->void
{
HackCore.Box3D = !HackCore.Box3D;
//.........这里部分代码省略.........