Пример #1
0
        private void createTopBar()
        {
            GuiLayer topBar = View.GetMainView().AddLayer("TopBar", new Rectangle(0, 0, 200, 40));
            //topBar.SetPosition(Game.GetRenderer().GetSize().width / 2 - 100, Game.GetRenderer().GetSize().height - topBar.GetSize().height);
            topBar.SetPosition(Game.GetRenderer().GetSize().width / 2 - 100, 0);

            // Wave GUI
            // The current wave we're on.
            LabelValue currentWave = new LabelValue(topBar, "Wave", "0");
            currentWave.SetPosition(0, 0);
            // The total number of entities in the wave.
            LabelValue totalWaves = new LabelValue(topBar, "/", "0");
            totalWaves.SetPosition(60, 0);

            // Which number in the wave is currently spawning.
            LabelValue wavePosition = new LabelValue(topBar, "Enemy", "0");
            wavePosition.SetPosition(100, 0);
            // The number of entities in the wave.
            LabelValue waveCount = new LabelValue(topBar, "/", "0");
            waveCount.SetPosition(160, 0);
        }
Пример #2
0
        // Functionless information readout. Does nothing but report information to the player.
        private void createHUD()
        {
            //create the layer itself
            GuiLayer hud = View.GetMainView().AddLayer("HUD", new Rectangle(-100, -100, 146, 100));

            LabelValue currency = new LabelValue(hud, "Bacon", playerCurrency.ToString());
            currency.SetPosition(0, 0);

            LabelValue health = new LabelValue(hud, "Karma", playerHealth.ToString());
            health.SetPosition(0, 20);
        }