当前位置: 首页>>代码示例>>C++>>正文


C++ Panel::AddElement方法代码示例

本文整理汇总了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;
//.........这里部分代码省略.........
开发者ID:ezhangle,项目名称:PVZ-Hack,代码行数:101,代码来源:Main.cpp


注:本文中的Panel::AddElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。