예제 #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()
        {
            if (null == GraphicsDevice)
            {
                return;
            }
            // Create a new SpriteBatch, which can be used to draw textures.
            m_spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            m_font = Content.Load <SpriteFont> (Activity1.GetLocalizedString("FontName"));

            //m_inactiveButton = Content.Load<Texture2D> ("ButtonInactive.png");
            //m_activeButton = Content.Load<Texture2D> ("ButtonActive.png");

            m_inactiveButton = GetAssetTexture("ButtonInactive.png");
            m_activeButton   = GetAssetTexture("ButtonActive.png");
        }
예제 #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            m_graphics.GraphicsDevice.DeviceReset += DeviceResetEvent;

            BtnRequestProducts              = new ButtonSprite();
            BtnRequestProducts.Position     = new Vector2(150, 200);
            BtnRequestProducts.TextureScale = new Vector2(2.25f, 0.5f);
            BtnRequestProducts.Text         = Activity1.GetLocalizedString("RequestProductList");
            BtnRequestProducts.TextOffset   = new Vector2(40, 20);
            m_buttons.Add(BtnRequestProducts);

            BtnRequestPurchase              = new ButtonSprite();
            BtnRequestPurchase.Position     = new Vector2(500, 200);
            BtnRequestPurchase.TextureScale = new Vector2(2f, 0.5f);
            BtnRequestPurchase.Text         = Activity1.GetLocalizedString("RequestPurchase");
            BtnRequestPurchase.TextOffset   = new Vector2(40, 20);
            m_buttons.Add(BtnRequestPurchase);

            BtnRequestReceipts              = new ButtonSprite();
            BtnRequestReceipts.Position     = new Vector2(800, 200);
            BtnRequestReceipts.TextureScale = new Vector2(2f, 0.5f);
            BtnRequestReceipts.Text         = Activity1.GetLocalizedString("RequestReceipts");
            BtnRequestReceipts.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnRequestReceipts);

            BtnRequestGamerInfo              = new ButtonSprite();
            BtnRequestGamerInfo.Position     = new Vector2(1100, 200);
            BtnRequestGamerInfo.TextureScale = new Vector2(2f, 0.5f);
            BtnRequestGamerInfo.Text         = Activity1.GetLocalizedString("RequestGamerInfo");
            BtnRequestGamerInfo.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnRequestGamerInfo);

            BtnExit              = new ButtonSprite();
            BtnExit.Position     = new Vector2(1400, 200);
            BtnExit.TextureScale = new Vector2(1f, 0.5f);
            BtnExit.Text         = Activity1.GetLocalizedString("Exit");
            BtnExit.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnExit);

            BtnPause              = new ButtonSprite();
            BtnPause.Position     = new Vector2(1650, 200);
            BtnPause.TextureScale = new Vector2(1f, 0.5f);
            BtnPause.Text         = Activity1.GetLocalizedString("Pause");
            BtnPause.TextOffset   = new Vector2(30, 20);
            m_buttons.Add(BtnPause);

            m_focusManager.SelectedButton = BtnRequestProducts;
            m_focusManager.Mappings [BtnRequestProducts] = new FocusManager.ButtonMapping()
            {
                Right = BtnRequestPurchase
            };
            m_focusManager.Mappings [BtnRequestPurchase] = new FocusManager.ButtonMapping()
            {
                Left  = BtnRequestProducts,
                Right = BtnRequestReceipts
            };
            m_focusManager.Mappings [BtnRequestReceipts] = new FocusManager.ButtonMapping()
            {
                Left  = BtnRequestPurchase,
                Right = BtnRequestGamerInfo,
            };

            m_focusManager.Mappings [BtnRequestGamerInfo] = new FocusManager.ButtonMapping()
            {
                Left  = BtnRequestReceipts,
                Right = BtnExit,
            };

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

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