Beispiel #1
0
 protected void SetPositions()
 {
     for (var i = 0; i < MenuItems.Count; ++i)
     {
         MenuItems[i].ItemPosition = ShortCuts.ScreenCenter -
                                     ShortCuts.GetFontCenter(FontName, MenuItems[i].ItemName) +
                                     (i - 2) * ItemOffset;
     }
 }
        protected override void Draw()
        {
            base.Draw();
            _spriteBatch.Begin();
            _spriteBatch.DrawString(Editor.Font, "Hello World", new Vector2(150, 150), Color.White);
            _spriteBatch.End();
            return;

            GraphicsDevice.SetRenderTarget(_renderTarget);
            GraphicsDevice.Viewport = _standardViewport;
            GraphicsDevice.Clear(Color.Black);
            _spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            if (!MapLoaded)
            {
                _spriteBatch.DrawString(FontProvider.GetFont("Mono8"), "Please load a map.",
                                        ShortCuts.ScreenCenter - ShortCuts.GetFontCenter("Mono8", "Please load a map."),
                                        Color.Green);
            }
            else if (DrawAll)
            {
                TileMap.Draw();
            }
            else
            {
                TileMap.Draw(Layer);
            }
            EntityManager.Draw();
            _bulletManager.Draw();
            _spriteBatch.End();
            DrawHelper.Draw();
            GraphicsDevice.SetRenderTarget(null);
            GraphicsDevice.Viewport = _renderViewport;
            GraphicsDevice.Clear(Color.LightBlue);
            _spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null);
            _spriteBatch.Draw(_renderTarget, new Rectangle(0, 0, _renderViewport.Width, _renderViewport.Height),
                              Color.White);
            _spriteBatch.End();
        }