public void Run()
		{
			while(true)
			{
				ISample selected = null;

				Engine.Initialize("サンプルブラウザ", 640, 480, new EngineOption(){ GraphicsDevice = GraphicsDeviceType.DirectX11 });

				var scene = new Scene();
				var layer = new SampleBrowserLayer(samples);
                var infoLayer = new SampleInfoLayer(layer.TotalHeight)
                {
	                DrawingPriority = 2
                };

				layer.OnScroll.Subscribe(y => infoLayer.MoveScrollBar(y));
				layer.OnSelectionChanged.Subscribe(s => infoLayer.Show(s));
				layer.OnDecide.Subscribe(s => selected = s);

				Engine.ChangeScene(scene);
				scene.AddLayer(layer);
                scene.AddLayer(infoLayer);

				var hintLayer = new Layer2D();
				hintLayer.AddObject(new TextureObject2D()
				{
					Texture = Engine.Graphics.CreateTexture2D("Data/Browser/Hint.png")
				});

				scene.AddLayer(hintLayer);

				while(Engine.DoEvents() && selected == null)
				{
					Engine.Update();
				}

				Engine.Terminate();

				if(selected == null)
				{
					break;
				}
				selected.Run();
			}
		}
Beispiel #2
0
        public void Run()
        {
            while (true)
            {
                ISample selected = null;

                Engine.Initialize("サンプルブラウザ", 640, 480, new EngineOption());

                var scene = new Scene();
                var layer = new SampleBrowserLayer(samples);
                layer.OnDecide += s => selected = s;

                Engine.ChangeScene(scene);
                scene.AddLayer(layer);

                var hintLayer = new Layer2D();
                hintLayer.AddObject(new TextureObject2D()
                {
                    Texture = Engine.Graphics.CreateTexture2D("Data/Browser/Hint.png")
                });

                scene.AddLayer(hintLayer);

                while (Engine.DoEvents() && selected == null)
                {
                    Engine.Update();
                }

                Engine.Terminate();

                if (selected == null)
                {
                    break;
                }
                selected.Run();
            }
        }