Пример #1
0
        /// <summary>
        /// Initializes the <see cref="Manager"/> class with the given values.
        /// </summary>
        /// <param name="device">
        /// A <see cref="GraphicsDevice"/> used to create default objects.
        /// </param>
        /// <param name="font">
        /// A <see cref="SpriteFont"/> used as default <see cref="SpriteFont"/>.
        /// </param>
        public static void Initialize(GraphicsDevice device, SpriteFont font)
        {
            Manager.graphicsDevice = device;
            Manager.spriteBatch    = new ComponentSpriteBatch(device);
            Texture2D texture = new Texture2D(device, 1, 1);

            texture.SetData(new[] { Color.White });
            FormsKeyboard.Initialize();
            DefaultStyles.Initialize(device, font);
            Manager.IsInitialized = true;
        }
Пример #2
0
        /// <summary>
        /// Initializes the <see cref="Manager"/> class with the given values.
        /// </summary>
        /// <param name="device">
        /// A <see cref="GraphicsDevice"/> used to create default objects.
        /// </param>
        /// <param name="font">
        /// A <see cref="SpriteFont"/> used as default <see cref="SpriteFont"/>.
        /// </param>
        /// <param name="window">
        /// An instance of <see cref="GameWindow"/> used by XnaForms.
        /// </param>
        public static void Initialize(GraphicsDevice device, SpriteFont font, GameWindow window)
        {
            Manager.graphicsDevice     = device;
            Manager.spriteBatch        = new ComponentSpriteBatch(device);
            Manager.window             = window;
            Manager.keyboardDispatcher = new KeyboardDispatcher(window);
            Texture2D texture = new Texture2D(device, 1, 1);

            texture.SetData <Color>(new[] { Color.White });
            DefaultStyles.Initialize(device, font);
            Manager.IsInitialized = true;
        }