コード例 #1
0
ファイル: User.cs プロジェクト: ozzyonfire/CircleOfLife
        public void initializeMenuScreen()
        {
            perkTree = new PerkTree();
            effects = new Effects();

            Perk newPerk;

            newPerk = perkTree.add("Herbivore", new Vector2(650, 150));
            newPerk.effects = "Allows creature to\n consume plants";
            newPerk.cost = "O: 100     E: 0";
            newPerk.oCost = 100;
            newPerk.eCost = 0;
            newPerk = perkTree.add("Carnivore", new Vector2(900, 150));
            newPerk.effects = "Allows creature to\nconsume creatures";
            newPerk.cost = "O: 500     E: 1";
            newPerk.oCost = 500;
            newPerk.eCost = 1;
            newPerk = perkTree.add("Pincer", new Vector2(650, 450));
            newPerk.effects = "Increased attack\nFaster consumption";
            newPerk.cost = "O: 500     E: 5";
            newPerk.oCost = 500;
            newPerk.eCost = 5;
            newPerk = perkTree.add("Tail", new Vector2(650, 300));
            newPerk.effects = "Increased speed";
            newPerk.cost = "O: 500     E: 5";
            newPerk.oCost = 500;
            newPerk.eCost = 5;
            newPerk = perkTree.add("Eyes", new Vector2(900, 300));
            newPerk.effects = "Increased detection";
            newPerk.cost = "O: 200    E: 5";
            newPerk.oCost = 200;
            newPerk.eCost = 5;
            newPerk = perkTree.add("Swarm", new Vector2(1150, 300));
            newPerk.effects = "Increased birth rate";
            newPerk.cost = "O: 1000     E: 10";
            newPerk.oCost = 1000;
            newPerk.eCost = 10;
            newPerk = perkTree.add("Scent", new Vector2(900, 450));
            newPerk.effects = "Detection of corpses";
            newPerk.cost = "O: 500     E: 5";
            newPerk.oCost = 500;
            newPerk.eCost = 5;
            newPerk = perkTree.add("Bulk", new Vector2(1150, 450));
            newPerk.effects = "Increased defence\nSlower speed";
            newPerk.cost = "O: 1500     E: 5";
            newPerk.oCost = 1500;
            newPerk.eCost = 5;
            newPerk = perkTree.add("Hibernate", new Vector2(650, 600));
            newPerk.effects = "Conserve energy by\nremaining still";
            newPerk.cost = "O: 1000     E: 10";
            newPerk.oCost = 1000;
            newPerk.eCost = 10;
            newPerk = perkTree.add("Canibal", new Vector2(900, 600));
            newPerk.effects = "Consume corpses of\nsame species";
            newPerk.cost = "O: 200     E: 5";
            newPerk.oCost = 200;
            newPerk.eCost = 5;

            //initialize elements
            speciesList = new Nuclex.UserInterface.Controls.Desktop.ListControl();
            upgradeButton = new Nuclex.UserInterface.Controls.Desktop.ButtonControl();
            cancelButton = new Nuclex.UserInterface.Controls.Desktop.ButtonControl();
            //menuSlider = new Nuclex.UserInterface.Controls.Desktop.HorizontalSliderControl();
            //description = new Nuclex.UserInterface.Controls.LabelControl();

            speciesList.Bounds = new UniRectangle(new UniScalar(0.0f, 50.0f),new UniScalar(0.0f, 200.0f),new UniScalar(0.0f, 300.0f),new UniScalar(0.0f, 250.0f));
            speciesList.SelectionMode = Nuclex.UserInterface.Controls.Desktop.ListSelectionMode.Single;
            speciesList.SelectionChanged += new EventHandler(speciesList_SelectionChanged);

            upgradeButton.Bounds = new UniRectangle(new UniScalar(0.02f, 0.0f), new UniScalar(0.0f, 700.0f), new UniScalar(0.0f, 250.0f), new UniScalar(0.0f, 50.0f));
            upgradeButton.Text = "Upgrade";
            upgradeButton.Pressed += new EventHandler(upgradeButton_Pressed);

            cancelButton.Bounds = new UniRectangle(new UniScalar(0.02f, 260.0f), new UniScalar(0.0f, 700.0f), new UniScalar(0.0f, 250.0f), new UniScalar(0.0f, 50.0f));
            cancelButton.Text = "Cancel";
            cancelButton.Pressed += new EventHandler(cancelButton_Pressed);

            //menuSlider.Bounds = new UniRectangle(new UniScalar(0.3f, 0), new UniScalar(0.75f, 0),new UniScalar(0.5f,0), new UniScalar(0.0f, 30));
            //menuSlider.ThumbSize = 0.1f;
            //menuSlider.Moved += new EventHandler(perkSliderMoved);

            //description.Bounds = new UniRectangle(new UniScalar(0.3f, 0), new UniScalar(0.8f, 0), new UniScalar(0.5f, 0), new UniScalar(0.2f, 0));
            //description.Text = Sprites.description;

            menuScreen.Desktop.Children.Add(speciesList);
            menuScreen.Desktop.Children.Add(upgradeButton);
            menuScreen.Desktop.Children.Add(cancelButton);
        }
コード例 #2
0
ファイル: User.cs プロジェクト: kevinh111/CircleOfLife
        public void initializeMenuScreen()
        {
            perkTree = new PerkTree();
            effects = new Effects();

            //initialize elements
            speciesList = new Nuclex.UserInterface.Controls.Desktop.ListControl();
            Nuclex.UserInterface.Controls.Desktop.ButtonControl createButton = new Nuclex.UserInterface.Controls.Desktop.ButtonControl();
            //menuSlider = new Nuclex.UserInterface.Controls.Desktop.HorizontalSliderControl();
            description = new Nuclex.UserInterface.Controls.LabelControl();

            speciesList.Bounds = new UniRectangle(new UniScalar(0.0f, 50.0f),new UniScalar(0.0f, 200.0f),new UniScalar(0.0f, 300.0f),new UniScalar(0.0f, 300.0f));
            speciesList.SelectionMode = Nuclex.UserInterface.Controls.Desktop.ListSelectionMode.Single;

            createButton.Bounds = new UniRectangle(new UniScalar(0.0f, 50.0f),new UniScalar(0.0f, 505.0f),new UniScalar(0.0f, 300.0f),new UniScalar(0.0f, 50.0f));
            createButton.Text = "New Species";

            //menuSlider.Bounds = new UniRectangle(new UniScalar(0.3f, 0), new UniScalar(0.75f, 0),new UniScalar(0.5f,0), new UniScalar(0.0f, 30));
            //menuSlider.ThumbSize = 0.1f;
            //menuSlider.Moved += new EventHandler(perkSliderMoved);

            description.Bounds = new UniRectangle(new UniScalar(0.3f, 0), new UniScalar(0.8f, 0), new UniScalar(0.5f, 0), new UniScalar(0.2f, 0));
            description.Text = Sprites.description;

            //menuScreen.Desktop.Children.Add(menuSlider);
            //menuScreen.Desktop.Children.Add(speciesList);
            //menuScreen.Desktop.Children.Add(createButton);
            menuScreen.Desktop.Children.Add(description);
        }