Exemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Exemplo n.º 2
0
        public void Initialize(Game1 game)
        {
            var skin = new Skin(game.GreyImageMap, game.GreyMap);
            var text = new TextRenderer(game.GreySpriteFont, Color.White);
            const int margin = 10;
            const int buttonHeight = 40;

            int i = -1;

            gui = new Gui(game, skin, text)
            {
                Widgets = new Widget[] {
                    useToonButton = new ToggleButton(margin, margin + (buttonHeight * ++i), "Use Toon") {
                        IsToggled = true
                    },
                    drawOutlineButton = new ToggleButton(margin, margin + (buttonHeight * ++i), "Draw Outline") {
                        IsToggled = true
                    },
                    useXToon = new ToggleButton(margin, margin + (buttonHeight * ++i), "Use X-Toon") {
                        IsToggled = false
                    },
                    secondDimension = new ComboBox(margin + 100, margin + (buttonHeight * i), 150, "Second Dimension", CardinalDirection.South,
                        new List<ComboBox.DropDownItem>() {
                            new ComboBox.DropDownItem("Distance"),
                            new ComboBox.DropDownItem("Angle")
                        }),
                    useTextureButton = new ToggleButton(margin, margin + (buttonHeight * ++i), "Use Textures") {
                        IsToggled = true
                    },
                    edgeWidth = new Slider(margin, margin + (buttonHeight * ++i), 150, delegate(Widget slider) {
                        edgeWidthLabel.Value = "Edge Width = " + (((Slider)slider).Value * maxEdgeWidth);
                    }) {
                        Value = 1 / maxEdgeWidth
                    },
                    edgeWidthLabel = new Label(margin, margin + (buttonHeight * ++i), "Edge Width = 1.0"),
                    edgeIntensity = new Slider(margin, margin + (buttonHeight * ++i), 150, delegate(Widget slider) {
                        edgeIntensityLabel.Value = "Edge Intensity = " + (((Slider)slider).Value * maxEdgeIntensity);
                    }) {
                        Value = 1 / maxEdgeIntensity
                    },
                    edgeIntensityLabel = new Label(margin, margin + (buttonHeight * ++i), "Edge Intensity = 1.0"),
                    detailAdjustment = new Slider(margin, margin + (buttonHeight * ++i), 150, delegate(Widget slider) {
                        detailAdjustmentLabel.Value = "Detail Adjustment = " + (((Slider)slider).Value * maxDetail);
                    }) {
                       Value = 1 / maxDetail
                    },
                    detailAdjustmentLabel = new Label(margin, margin + (buttonHeight * ++i), "Detail Adjustment = 1.0"),
                    useLightDirections = new ToggleButton(margin, margin + (buttonHeight * ++i), "Use Light Directions"),
                    lightAttentuation = new Slider(margin, margin + (buttonHeight * ++i), 150, delegate(Widget slider) {
                        lightAttenuationLabel.Value = "Light attenuation = " + (((Slider)slider).Value * maxAttenuation);
                    }) {
                        Value = 1200 / maxAttenuation
                    },
                    lightAttenuationLabel = new Label(margin, margin + (buttonHeight * ++i), "Light attentuation = 1200.0"),
                    disableLighting = new ToggleButton(margin, margin + (buttonHeight * ++i), "Disable lighting")
                }
            };
        }