Beispiel #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            font = Content.Load <SpriteFont>("spriteFont1");

            BtnGetProducts = new ButtonSprite();
            BtnGetProducts.Initialize(font,
                                      Content.Load <Texture2D>("Graphics\\ButtonActive"),
                                      Content.Load <Texture2D>("Graphics\\ButtonInactive"));
            BtnGetProducts.Position     = new Vector2(150, 200);
            BtnGetProducts.TextureScale = new Vector2(2f, 0.5f);
            BtnGetProducts.Text         = "Get Product List";
            BtnGetProducts.TextOffset   = new Vector2(40, 20);
            m_buttons.Add(BtnGetProducts);

            BtnPurchase = new ButtonSprite();
            BtnPurchase.Initialize(font,
                                   Content.Load <Texture2D>("Graphics\\ButtonActive"),
                                   Content.Load <Texture2D>("Graphics\\ButtonInactive"));
            BtnPurchase.Position     = new Vector2(600, 200);
            BtnPurchase.TextureScale = new Vector2(2f, 0.5f);
            BtnPurchase.Text         = "Request Purchase";
            BtnPurchase.TextOffset   = new Vector2(40, 20);
            m_buttons.Add(BtnPurchase);

            BtnGetReceipts = new ButtonSprite();
            BtnGetReceipts.Initialize(font,
                                      Content.Load <Texture2D>("Graphics\\ButtonActive"),
                                      Content.Load <Texture2D>("Graphics\\ButtonInactive"));
            BtnGetReceipts.Position     = new Vector2(1100, 200);
            BtnGetReceipts.TextureScale = new Vector2(1.5f, 0.5f);
            BtnGetReceipts.Text         = "Get Receipts";
            BtnGetReceipts.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnGetReceipts);

            BtnGetUUID = new ButtonSprite();
            BtnGetUUID.Initialize(font,
                                  Content.Load <Texture2D>("Graphics\\ButtonActive"),
                                  Content.Load <Texture2D>("Graphics\\ButtonInactive"));
            BtnGetUUID.Position     = new Vector2(1400, 200);
            BtnGetUUID.TextureScale = new Vector2(1.25f, 0.5f);
            BtnGetUUID.Text         = "Get UUID";
            BtnGetUUID.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnGetUUID);

            BtnPause = new ButtonSprite();
            BtnPause.Initialize(font,
                                Content.Load <Texture2D>("Graphics\\ButtonActive"),
                                Content.Load <Texture2D>("Graphics\\ButtonInactive"));
            BtnPause.Position     = new Vector2(1650, 200);
            BtnPause.TextureScale = new Vector2(1f, 0.5f);
            BtnPause.Text         = "Pause";
            BtnPause.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnPause);

            m_focusManager.SelectedButton           = BtnGetProducts;
            m_focusManager.Mappings[BtnGetProducts] = new FocusManager.ButtonMapping()
            {
                Right = BtnPurchase
            };
            m_focusManager.Mappings[BtnPurchase] = new FocusManager.ButtonMapping()
            {
                Left  = BtnGetProducts,
                Right = BtnGetReceipts
            };
            m_focusManager.Mappings[BtnGetReceipts] = new FocusManager.ButtonMapping()
            {
                Left  = BtnPurchase,
                Right = BtnGetUUID,
            };

            m_focusManager.Mappings[BtnGetUUID] = new FocusManager.ButtonMapping()
            {
                Left = BtnGetReceipts,
            };

            m_focusManager.Mappings[BtnPause] = new FocusManager.ButtonMapping()
            {
                Left = BtnGetUUID,
            };
        }
Beispiel #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            font = Content.Load<SpriteFont>("spriteFont1");

            BtnGetProducts = new ButtonSprite();
            BtnGetProducts.Initialize(font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            BtnGetProducts.Position = new Vector2(150, 200);
            BtnGetProducts.TextureScale = new Vector2(2f, 0.5f);
            BtnGetProducts.Text = "Get Product List";
            BtnGetProducts.TextOffset = new Vector2(40, 20);
            m_buttons.Add(BtnGetProducts);

            BtnPurchase = new ButtonSprite();
            BtnPurchase.Initialize(font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            BtnPurchase.Position = new Vector2(600, 200);
            BtnPurchase.TextureScale = new Vector2(2f, 0.5f);
            BtnPurchase.Text = "Request Purchase";
            BtnPurchase.TextOffset = new Vector2(40, 20);
            m_buttons.Add(BtnPurchase);

            BtnGetReceipts = new ButtonSprite();
            BtnGetReceipts.Initialize(font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            BtnGetReceipts.Position = new Vector2(1100, 200);
            BtnGetReceipts.TextureScale = new Vector2(1.5f, 0.5f);
            BtnGetReceipts.Text = "Get Receipts";
            BtnGetReceipts.TextOffset = new Vector2(30, 20);
            m_buttons.Add(BtnGetReceipts);

            BtnGetUUID = new ButtonSprite();
            BtnGetUUID.Initialize(font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            BtnGetUUID.Position = new Vector2(1400, 200);
            BtnGetUUID.TextureScale = new Vector2(1.25f, 0.5f);
            BtnGetUUID.Text = "Get UUID";
            BtnGetUUID.TextOffset = new Vector2(30, 20);
            m_buttons.Add(BtnGetUUID);

            BtnPause = new ButtonSprite();
            BtnPause.Initialize(font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            BtnPause.Position = new Vector2(1650, 200);
            BtnPause.TextureScale = new Vector2(1f, 0.5f);
            BtnPause.Text = "Pause";
            BtnPause.TextOffset = new Vector2(30, 20);
            m_buttons.Add(BtnPause);

            m_focusManager.SelectedButton = BtnGetProducts;
            m_focusManager.Mappings[BtnGetProducts] = new FocusManager.ButtonMapping()
                                                          {
                                                              Right = BtnPurchase
                                                          };
            m_focusManager.Mappings[BtnPurchase] = new FocusManager.ButtonMapping()
                                                       {
                                                           Left = BtnGetProducts,
                                                           Right = BtnGetReceipts
                                                       };
            m_focusManager.Mappings[BtnGetReceipts] = new FocusManager.ButtonMapping()
            {
                Left = BtnPurchase,
                Right = BtnGetUUID,
            };

            m_focusManager.Mappings[BtnGetUUID] = new FocusManager.ButtonMapping()
            {
                Left = BtnGetReceipts,
            };

            m_focusManager.Mappings[BtnPause] = new FocusManager.ButtonMapping()
            {
                Left = BtnGetUUID,
            };
        }