Ejemplo n.º 1
0
        public static void Register(SpriteBatch spriteBatch)
        {
            if (_registered) return;
            _registered = true;

            MouseLib.App.Register();

            var text = new Text(spriteBatch, DependencyInjection.Resolve<IMouseInput>());

            DependencyInjection.Register((IText)text);
            DependencyInjection.Register((ITextContent)text);
        }
Ejemplo n.º 2
0
Archivo: Game1.cs Proyecto: zarac/tgspu
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = Content.Load<SpriteFont>("Arial");
            text = new Text(spriteBatch, font);

            legsTex = new Texture2D[1];
            torsoTex = new Texture2D[1];
            headTex = new Texture2D[1];
            weaponTex = new Texture2D[1];

            LoadTextures(legsTex, @"gfx/legs");
            LoadTextures(torsoTex, @"gfx/torso");
            LoadTextures(headTex, @"gfx/head");
            LoadTextures(weaponTex, @"gfx/weapon");

            // Testar lite jao
            text.Color = Color.Red;
        }
Ejemplo n.º 3
0
        protected override void LoadContent()
        {
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _font = Content.Load<SpriteFont>(@"Fonts/Arial");

            _text = new Text(_spriteBatch, _font);

            _nullTex = Content.Load<Texture2D>(@"gfx/1x1");
            _iconsTex = Content.Load<Texture2D>(@"gfx/icons");

            LoadTextures(_legsTex, @"gfx/legs");
            LoadTextures(_torsoTex, @"gfx/torso");
            LoadTextures(_headTex, @"gfx/head");
            LoadTextures(_weaponTex, @"gfx/weapon");
        }