コード例 #1
0
ファイル: Game1.cs プロジェクト: thoniorf/ouya-sdk-examples
        /// <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()
        {
            Vector2 position = new Vector2();
            for (int index = 0; index < MAX_CONTROLLERS; ++index)
            {
                VirtualControllerSprite controller = new VirtualControllerSprite();
                switch (index)
                {
                    case 0:
                        position = new Vector2(500, 200);
                        break;
                    case 1:
                        position = new Vector2(1100, 200);
                        break;
                    case 2:
                        position = new Vector2(500, 500);
                        break;
                    case 3:
                        position = new Vector2(1100, 500);
                        break;
                }                
                controller.Index = index;
                controller.Position = position;
                Controllers.Add(controller);
            }

            base.Initialize();
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: kblood/ouya-sdk-examples
        /// <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()
        {
            Vector2 position = new Vector2();

            for (int index = 0; index < MAX_CONTROLLERS; ++index)
            {
                VirtualControllerSprite controller = new VirtualControllerSprite();
                switch (index)
                {
                case 0:
                    position = new Vector2(500, 200);
                    break;

                case 1:
                    position = new Vector2(1100, 200);
                    break;

                case 2:
                    position = new Vector2(500, 500);
                    break;

                case 3:
                    position = new Vector2(1100, 500);
                    break;
                }
                controller.Index    = index;
                controller.Position = position;
                Controllers.Add(controller);
            }

            base.Initialize();
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: toxa17/ouya-sdk-examples
        /// <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()
        {
            for (int index = 0; index < MAX_CONTROLLERS; ++index)
            {
                VirtualControllerSprite controller = new VirtualControllerSprite();
                Vector2 position = new Vector2(
                    GraphicsDevice.Viewport.TitleSafeArea.X + 175 + index * 350,
                    GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
                controller.Index    = (PlayerIndex)index;
                controller.Position = position;
                m_controllers.Add(controller);
            }

            base.Initialize();
        }
コード例 #4
0
ファイル: Game1.cs プロジェクト: xmcnuggetx/ouya-sdk-examples
        /// <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()
        {
            for (int index = 0; index < MAX_CONTROLLERS; ++index)
            {
                VirtualControllerSprite controller = new VirtualControllerSprite();
                Vector2 position = new Vector2(
                    GraphicsDevice.Viewport.TitleSafeArea.X + 175 + index * 350,
                    GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
                controller.Index = (PlayerIndex)index;
                controller.Position = position;
                m_controllers.Add(controller);
            }

            base.Initialize();
        }