Example #1
0
        public void Initialize()
        {
            m_drawable = new List<IDrawable>();
            m_interactable = new List<IInteractable>();

            TextScreenObject newGameButton = new TextScreenObject()
            {
                Text = "New Game",
                TextColor = Color.BlanchedAlmond,
                AssetName = "warlock_button",
                ScreenPosition = new Vector2(WarlockGame.Graphics.GraphicsDevice.Viewport.Width / 2, WarlockGame.Graphics.GraphicsDevice.Viewport.Height / 2 - 30),
                TapDelegate = WarlockGame.Instance.StartNewGame
            };

            TextScreenObject exitGameButton = new TextScreenObject()
            {
                Text = "Exit",
                TextColor = Color.BlanchedAlmond,
                AssetName = "warlock_button",
                ScreenPosition = new Vector2(WarlockGame.Graphics.GraphicsDevice.Viewport.Width / 2, WarlockGame.Graphics.GraphicsDevice.Viewport.Height / 2 + 30),
                TapDelegate = WarlockGame.Instance.Exit
            };

            // these should always be added in opposite order so that objects drawn on top get interaction priority
            m_drawable.Add(newGameButton);
            m_drawable.Add(exitGameButton);

            m_interactable.Add(exitGameButton);
            m_interactable.Add(newGameButton);

            TouchPanel.EnabledGestures = GestureType.Tap;
        }
Example #2
0
        public HUD()
        {
            // Center-on-player button
            m_actionButton = new ActionButton()
            {
                AssetName = "meteor_icon",
                ScreenPosition = new Vector2(10, 422)
            };

            m_instructions = new TextScreenObject()
            {
                AssetName = "warlock_standard",
                ScreenPosition = new Vector2(250, 40),
                TextColor = Color.Black,
                Text = "Choose an action"
            };
        }