本文整理汇总了C++中Console::Toggle方法的典型用法代码示例。如果您正苦于以下问题:C++ Console::Toggle方法的具体用法?C++ Console::Toggle怎么用?C++ Console::Toggle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console::Toggle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ToggleConsole
void UI::ToggleConsole()
{
Console* console = GetSubsystem<Console>();
if (!console)
return;
console->Toggle();
consoleVisible_ = console->IsVisible();
}
示例2: HandleKeyDown
void GameMain::HandleKeyDown(StringHash eventType, VariantMap& eventData)
{
using namespace KeyDown;
int key = eventData[P_KEY].GetInt();
Input* input_ = GetSubsystem<Input>();
UI* ui = GetSubsystem<UI>();
UIElement* root = ui->GetRoot();
if (key == KEY_ESC)
{
menu.isActive = !menu.isActive;
Vector<SharedPtr<UIElement>> elements = root->GetChildren();
for (unsigned int i = 0; i < elements.Size(); i++)
{
if (elements[i]->GetVar("MENU").GetInt() == 1)
elements[i]->SetVisible(menu.isActive);
}
input_->SetMouseVisible(menu.isActive);
}
else if (key == KEY_F1)
{
Console* console = GetSubsystem<Console>();
console->Toggle();
}
if (key == KEY_F2) drawDebug_ = !drawDebug_;
if (key == KEY_F3) GetSubsystem<DebugHud>()->ToggleAll();
if (key == KEY_F)
{
static bool flee = false;
world.flyingShips.shipScript_->SetFlee(flee);
flee = !flee;
}
if (key == KEY_G)
{
}
}
示例3: HandleKeyDown
void UrhoQuickStart::HandleKeyDown(StringHash eventType, VariantMap& eventData)
{
using namespace KeyDown;
int key = eventData[P_KEY].GetInt();
if (key == KEY_ESC)
{
Console* console = GetSubsystem<Console>();
if (console->IsVisible())
console->SetVisible(false);
else
engine_->Exit();
}
else if (key == KEY_F1)
{
Console* console = GetSubsystem<Console>();
console->Toggle();
}
if (key == KEY_F2) drawDebug_ = !drawDebug_;
if (key == KEY_E)
{
Vector3 hitPos;
Drawable* hitDrawable;
NavigationMesh* navMesh = scene_->GetComponent<NavigationMesh>();
if (Raycast(250.0f, hitPos, hitDrawable))
{
Vector3 pathPos = navMesh->FindNearestPoint(hitPos, Vector3(2.0f, 2.0f, 2.0f));
botScript_->AddPath(botNode_->GetWorldPosition(), pathPos);
}
}
}