Exemple #1
0
        static public void DrawCircleAll(SpriteBatch spriteBatch, Vector2 Position, int Range, Color color)
        {
            if (m_LineTexture == null)
            {
                CreateLineTexture(spriteBatch.GraphicsDevice);
            }
            var FixcelValue = (int)((float)Range * Math.PI);

            for (int i = 0; i < FixcelValue; i++)
            {
                var Rotaition = 3.14f * (((float)i) / (float)FixcelValue) * 2;
                var ViewPos   = MathExt.Anlge2Position360(Position, Range / 2, Rotaition);
                spriteBatch.Draw(m_LineTexture, ViewPos, null, color, Rotaition, Vector2.Zero, 1, SpriteEffects.None, 1.0f);
                DrawLine(spriteBatch, Position, ViewPos, color);
            }
        }
Exemple #2
0
 public static Vector2 GetHeadPosition(Vector2 Position, int Range, float Rotation)
 {
     return(MathExt.Anlge2Position360(Position, Range, MathExt.DirectionConverter(Rotation, 90)));
 }