Ejemplo n.º 1
0
 protected override void Initialize()
 {
     if (_content == null)
     {
         _content = new PlainContentManager(Services);
     }
     if (_renderer == null)
     {
         _renderer = new SpriteBatchRenderer();
     }
     _renderer.GraphicsDeviceService = (IGraphicsDeviceService)Services.GetService(typeof(IGraphicsDeviceService));
     if (_circle == null)
     {
         try
         {
             _circle = new FilledEllipse(_content, GraphicsDeviceManager)
             {
                 Gradient = 2,
                 Color    = Color.SlateBlue * 0.5f
             };
         }
         catch (Exception ex)
         {
             Console.WriteLine("Failed initializing ellipse: " + ex);
         }
     }
     LoadContent();
 }
Ejemplo n.º 2
0
        public void OnGraphicsDeviceCreated(GraphicsDeviceCreated message)
        {
            var content = ((ContentSystem)Manager.GetSystem(ContentSystem.TypeId)).Content;

            _spriteBatch = new SpriteBatch(message.Graphics.GraphicsDevice);
            if (_ellipse == null)
            {
                _ellipse = new Ellipse(content, message.Graphics)
                {
                    Thickness  = OrbitThickness,
                    BlendState = BlendState.Additive
                };
                _ellipse.LoadContent();
            }
            if (_filledEllipse == null)
            {
                _filledEllipse = new FilledEllipse(content, message.Graphics)
                {
                    Gradient   = DeadZoneDiffuseWidth,
                    Color      = DeadZoneColor,
                    BlendState = BlendState.Additive
                };
                _filledEllipse.LoadContent();
            }
        }