Ejemplo n.º 1
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp);
            // spriteBatch.Draw(spriteSheet, new Vector2 ( 10, 10 ), new Rectangle(0, 0, 32, 32), Color.White);
            // spriteBatch.Draw(spriteSheet, new Vector2(10, 100), new Rectangle(64, 0, 32, 32), Color.White);
            _editor.Draw(spriteBatch);
            EditorText.Draw(spriteBatch);
            // _testMap.Draw(spriteBatch);
            spriteBatch.End();
            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
Ejemplo n.º 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.
            ShapeGenerator.Initialize(GraphicsDevice);
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spriteSheet = Content.Load <Texture2D>("tileset1");


            _editor = new Editor();
            _editor.Load(Content);
            EditorText.Load(Content);
            KeyboardInput.AddKey(Keys.P);
            KeyboardInput.AddKey(Keys.Q);
            KeyboardInput.AddKey(Keys.E);
            //_testMap = new Map(500, 500, spriteSheet);
            //_testMap.Load(Content);

            // TODO: use this.Content to load your game content here
        }