本文整理汇总了C++中TestApplication::InputManager方法的典型用法代码示例。如果您正苦于以下问题:C++ TestApplication::InputManager方法的具体用法?C++ TestApplication::InputManager怎么用?C++ TestApplication::InputManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestApplication
的用法示例。
在下文中一共展示了TestApplication::InputManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Test
Test ()
{
//создание сцены
sprite [0] = Sprite::Create ();
sprite [0]->SetMaterial ("sprite_material");
sprite [0]->SetScale (10.0f, 10.0f, 1.0f);
sprite [0]->SetPosition (-3.0f, -3.0f, 0.5f);
sprite [0]->Rotate (math::anglef (), math::anglef (), math::degree (22.5f));
sprite [0]->SetColor (1.0f, 1.0f, 0.0f);
sprite [0]->SetMode (SpriteMode_Oriented);
sprite [0]->BindToScene (scene);
sprite [1] = Sprite::Create ();
sprite [1]->SetMaterial ("sprite_material");
sprite [1]->SetScale (10.0f, 10.0f, 1.0f);
sprite [1]->SetPosition (3.0f, 3.0f, 0.1f);
sprite [1]->SetColor (1.0f, 0.0f, 1.0f);
sprite [1]->SetMode (SpriteMode_Oriented);
sprite [1]->BindToScene (scene);
sprite [2] = Sprite::Create ();
sprite [2]->SetMaterial ("sprite_material");
sprite [2]->SetScale (10.0f, 10.0f, 1.0f);
sprite [2]->SetPosition (3.0f, -1.5f, 0.75f);
sprite [2]->SetColor (0.0f, 1.0f, 1.0f);
sprite [2]->SetMode (SpriteMode_Oriented);
sprite [2]->BindToScene (scene);
input_zone [0] = InputZone::Create ();
input_zone [0]->SetName ("zone1");
input_zone [0]->BindToParent (*sprite [0]);
input_zone [0]->RegisterNotificationHandler (&Test::InputNotify);
input_zone [1] = InputZone::Create ();
input_zone [1]->SetName ("zone2");
input_zone [1]->BindToParent (*sprite [1]);
input_zone [1]->RegisterNotificationHandler (&Test::InputNotify);
input_zone [2] = InputZone::Create ();
input_zone [2]->SetName ("zone3");
input_zone [2]->BindToParent (*sprite [2]);
input_zone [2]->RegisterNotificationHandler (&Test::InputNotify);
camera = PerspectiveCamera::Create ();
camera->BindToScene (scene);
camera->SetName ("Camera1");
camera->SetPosition (0, 0, -18.f);
camera->SetFovX (math::degree (70.f));
camera->SetFovY (math::degree (70.f));
camera->SetZNear (0.1f);
camera->SetZFar (20.f);
//создание областей вывода
Viewport vp1;
vp1.SetName ("Viewport1");
vp1.SetZOrder (0);
vp1.SetTechnique ("default");
vp1.SetCamera (camera.get ());
screen.Attach (vp1);
//настройка ввода
application.InputManager ().SetScreen (&screen);
// application.InputManager ().SetTouchSize (1.0f);
//настройка целевых буферов вывода
RenderTarget& render_target = application.RenderTarget ();
render_target.SetScreen (&screen);
//загрузка ресурсов
application.LoadResources ();
}