Esempio n. 1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public TitleMenu(DemoGame game)
     : base(game)
 {
     Entries.Add(new MenuEntry {
         Text = "basic effect", Clicked = delegate { Game.SetActiveMenu(1); }
     });
     Entries.Add(new MenuEntry {
         Text = "dual texture effect", Clicked = delegate { Game.SetActiveMenu(2); }
     });
     Entries.Add(new MenuEntry {
         Text = "alpha test effect", Clicked = delegate { Game.SetActiveMenu(3); }
     });
     Entries.Add(new MenuEntry {
         Text = "skinned effect", Clicked = delegate { Game.SetActiveMenu(4); }
     });
     Entries.Add(new MenuEntry {
         Text = "environment map effect", Clicked = delegate { Game.SetActiveMenu(5); }
     });
     Entries.Add(new MenuEntry {
         Text = "particles", Clicked = delegate { Game.SetActiveMenu(6); }
     });
     Entries.Add(new MenuEntry {
         Text = "quit", Clicked = delegate { game.Exit(); }
     });
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public AlphaDemo(DemoGame game)
     : base(game)
 {
     Entries.Add(new MenuEntry {
         Text = "back", Clicked = delegate { Game.SetActiveMenu(0); }
     });
 }
Esempio n. 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public ParticleDemo(DemoGame game)
            : base(game)
        {
            Entries.Add(spawnRate = new FloatMenuEntry()
            {
                Text = "spawn rate"
            });

            // This menu option for changing the resolution is currently disabled,
            // because the image scaler feature is not yet implemented in the CTP release.

            /*
             * Entries.Add(new ResolutionMenu(game.graphics));
             */

            Entries.Add(new MenuEntry
            {
                Text    = "back",
                Clicked = delegate
                {
                    // Before we quit back out of this menu, reset back to the default resolution.
                    if (game.Graphics.PreferredBackBufferWidth != 480)
                    {
                        game.Graphics.PreferredBackBufferWidth  = 480;
                        game.Graphics.PreferredBackBufferHeight = 800;

                        game.Graphics.ApplyChanges();
                    }

                    Game.SetActiveMenu(0);
                }
            });
        }
Esempio n. 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public BasicDemo(DemoGame game)
     : base(game)
 {
     Entries.Add(textureEnable = new BoolMenuEntry("texture"));
     Entries.Add(lightMode     = new LightModeMenu());
     Entries.Add(new MenuEntry {
         Text = "back", Clicked = delegate { Game.SetActiveMenu(0); }
     });
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public DualDemo(DemoGame game)
     : base(game)
 {
     Entries.Add(showTexture  = new BoolMenuEntry("texture"));
     Entries.Add(showLightmap = new BoolMenuEntry("light map"));
     Entries.Add(new MenuEntry {
         Text = "back", Clicked = delegate { Game.SetActiveMenu(0); }
     });
 }
Esempio n. 6
0
        /// <summary>
        /// Handles clicks on this menu entry.
        /// </summary>
        public virtual void OnClicked()
        {
            // If we have a click delegate, call that now.
            if (Clicked != null)
            {
                Clicked();
            }

            // If we are not draggable, spawn a visual feedback effect.
            if (!IsDraggable)
            {
                DemoGame.SpawnZoomyText(Text, Position + positionOffset);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public EnvmapDemo(DemoGame game)
     : base(game)
 {
     Entries.Add(amount = new FloatMenuEntry()
     {
         Text = "envmap"
     });
     Entries.Add(fresnel = new FloatMenuEntry()
     {
         Text = "fresnel"
     });
     Entries.Add(specular = new FloatMenuEntry()
     {
         Text = "specular"
     });
     Entries.Add(new MenuEntry {
         Text = "back", Clicked = delegate { Game.SetActiveMenu(0); }
     });
 }
Esempio n. 8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public MenuComponent(DemoGame game)
     : base(game)
 {
     Entries = new List <MenuEntry>();
 }
Esempio n. 9
0
 private static void Main()
 {
     using (var game = new DemoGame())
         game.Run();
 }