예제 #1
0
        protected override void Initialize()
        {
            base.Initialize();
            var camera = new Camera2D();
            var layout = Root.AddElement(new LinearLayout());

            layout.BackgroundColor = "0xffffff";
            layout.AddElement(new TextElement("Hello Thadius"));
            layout.Height = 1.0;
            layout.Width  = 1.0;
            var scene = layout.AddElement(new SceneScreen(camera));

            scene.AddElement(new DebugPrinter());
            camera.Position = new Vector2(0, 0);
            var manager = scene.Manager;

            manager.CreateEntity(new InitData <GameObject2D>()
                                 .Set("Texture", "thadius").Call("AddComponent", "Thadius"));
            InputLayout.AddBind("Forward", Keys.W);
            InputLayout.AddBind("RotateLeft", Keys.Q);
            InputLayout.AddBind("RotateRight", Keys.E);
            InputLayout.AddBind("LeftShift", Keys.LeftShift);
            layout.RegisterHandler(Keys.F1, (_) => { Game.Debug ^= true; });
        }
예제 #2
0
 protected override void Initialize()
 {
     base.Initialize();
     Root.AddElement(new DemoScene());
 }