Example #1
0
 /// <summary>
 /// Function to draw a filled ellipse onto the current target.
 /// </summary>
 /// <param name="dimensions">Ellipse dimensions.</param>
 /// <param name="color">Color for the ellipse.</param>
 /// <param name="quality">Quality of rendering for the ellipse.</param>
 /// <param name="texture">Texture to apply to the ellipse.</param>
 /// <param name="textureRegion">Texture dimensions to use.</param>
 /// <remarks>The <paramref name="quality"/> parameter can have a value from 4 to 256.  The higher the quality, the better looking the ellipse, however this will impact performance.</remarks>
 public void FilledEllipse(RectangleF dimensions, GorgonColor color, int quality, GorgonTexture2D texture, RectangleF textureRegion)
 {
     SetStates(_ellipse);
     _ellipse.IsFilled      = true;
     _ellipse.Position      = dimensions.Location;
     _ellipse.Size          = dimensions.Size;
     _ellipse.Color         = color;
     _ellipse.Quality       = quality;
     _ellipse.Texture       = texture;
     _ellipse.TextureRegion = textureRegion;
     _ellipse.Draw();
 }
Example #2
0
        public void TestEllipse()
        {
            _form.Show();
            _form.ClientSize = new Size(1280, 800);
            _form.Location   = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - 640, Screen.PrimaryScreen.WorkingArea.Height / 2 - 400);
            _form.BringToFront();
            _form.WindowState = FormWindowState.Minimized;
            _form.WindowState = FormWindowState.Normal;

            GorgonEllipse ellipse = _renderer.Renderables.CreateEllipse("Test",
                                                                        new Vector2(320, 400),
                                                                        new Vector2(100, 100),
                                                                        Color.Blue,
                                                                        true,
                                                                        32);

            Gorgon.Run(_form, () =>
            {
                _renderer.Clear(Color.Black);

                ellipse.Color    = Color.Blue;
                ellipse.IsFilled = true;
                ellipse.Position = new Vector2(480, 400);
                ellipse.Draw();

                ellipse.Color    = Color.Green;
                ellipse.IsFilled = false;
                ellipse.Position = new Vector2(800, 400);
                ellipse.Draw();

                _renderer.Render();

                return(true);
            });

            Assert.IsTrue(_form.TestResult == DialogResult.Yes);
        }