Example #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="position">Position of the vertex.</param>
 /// <param name="color">Color of the vertex.</param>
 /// <param name="textureCoordinates">Texture coordinates.</param>
 public PositionDiffuse2DTexture1(Vector3 position, Color color, Vector2 textureCoordinates) : this()
 {
     // Copy data.
     Position           = position;
     ColorValue         = ColorToInt(color);
     TextureCoordinates = textureCoordinates;
 }
Example #2
0
        /// <summary>
        /// Draws a Filled Point to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Point </param>
        /// <param name="posY"> Pos Y of Point </param>
        /// <param name="color"> Fill Color </param>
        public static void drawPoint(int posX, int posY, Color color)
        {
            RectangleShape Point = new RectangleShape();

            Point.Position  = new Vector2f(posX, posY);
            Point.Size      = new Vector2f(1, 1);
            Point.FillColor = color.Convert();

            CurrentRenderTarget.DrawSFML(Point);
        }
Example #3
0
        /// <summary>
        /// Draws text to the Current RenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of rectangle </param>
        /// <param name="posY"> Pos Y of rectangle </param>
        /// <param name="text"> Text to render </param>
        /// <param name="size"> Size of the font </param>
        /// <param name="textColor"> Color of the text </param>
        public static void drawText(float posX, float posY, string text, uint size, Color textColor, Font font)
        {
            Text _text = new Text(text, font.SFMLFont);

            _text.Position      = new SFML.System.Vector2f(posX, posY);
            _text.FillColor     = textColor.Convert();
            _text.CharacterSize = size;

            CurrentRenderTarget.DrawSFML(_text);
        }
Example #4
0
        /// <summary>
        /// Draws a Filled Circle to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Circle</param>
        /// <param name="posY"> Pos Y of Circle </param>
        /// <param name="radius"> Radius of Circle </param>
        /// <param name="color"> Fill Color </param>
        public static void drawCircle(int posX, int posY, int radius, Color color)
        {
            CircleShape Circle = new CircleShape();

            Circle.Position  = new Vector2f(posX, posY);
            Circle.Radius    = radius;
            Circle.FillColor = color.Convert();

            CurrentRenderTarget.DrawSFML(Circle);
        }
Example #5
0
        /// <summary>
        /// Draws a hollow Point to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Point </param>
        /// <param name="posY"> Pos Y of Point </param>
        /// <param name="OutlineColor"> Outline Color </param>
        public static void drawHollowPoint(int posX, int posY, Color OutlineColor)
        {
            RectangleShape hollowPoint = new RectangleShape();

            hollowPoint.Position         = new Vector2f(posX, posY);
            hollowPoint.Size             = new Vector2f(1, 1);
            hollowPoint.FillColor        = Color.Transparent.Convert();
            hollowPoint.OutlineThickness = .6f;
            hollowPoint.OutlineColor     = OutlineColor.Convert();

            CurrentRenderTarget.DrawSFML(hollowPoint);
        }
Example #6
0
 private static uint ColorToInt(Color color)
 => unchecked ((uint)(
                   (color.RByte << 16)
                   | (color.GByte << 8)
                   | (color.BByte)
                   | (color.AByte << 24)));
Example #7
0
        /// <summary>
        /// Draws a Line to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Line </param>
        /// <param name="posY"> Pos Y of Line </param>
        /// <param name="rotate"> Line Rotation </param>
        /// <param name="thickness"> Line Thickness </param>
        /// <param name="Color"> Line Color </param>
        public static void drawLine(float posX, float posY, float length, float rotate, float thickness, Color Color)
        {
            RectangleShape line = new RectangleShape();

            line.Position         = new Vector2f(posX, posY);
            line.Size             = new Vector2f(length, thickness);
            line.Rotation         = rotate;
            line.OutlineThickness = thickness;
            line.FillColor        = Color.Convert();
            line.OutlineColor     = Color.Convert();

            CurrentRenderTarget.DrawSFML(line);
        }
Example #8
0
        /// <summary>
        /// Draws a Hollow Circle to the CurrentRenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of Circle </param>
        /// <param name="posY"> Pos Y of Circle </param>
        /// <param name="radius"> Radius of Circle </param>
        /// <param name="OutlineThickness"> Thickness of Circle Outline </param>
        /// <param name="OutlineColor"> Circle outline Color </param>
        public static void drawHollowCircle(int posX, int posY, int radius, float OutlineThickness, Color OutlineColor)
        {
            CircleShape Circle = new CircleShape();

            Circle.Position         = new Vector2f(posX - radius, posY - radius);
            Circle.Radius           = radius;
            Circle.FillColor        = Color.Transparent.Convert();
            Circle.OutlineThickness = OutlineThickness;
            Circle.OutlineColor     = OutlineColor.Convert();

            CurrentRenderTarget.DrawSFML(Circle);
        }
Example #9
0
        /// <summary>
        /// Draws a Hollow Rectangle to the Current RenderTarget
        /// </summary>
        /// <param name="posX"> Pos X of rectangle </param>
        /// <param name="posY"> Pos Y of rectangle </param>
        /// <param name="widthX"> Width X of rectangle </param>
        /// <param name="heightY"> Height Y of rectangle </param>
        /// <param name="OutlineThickness"> Outline Thickness of rectangle </param>
        /// <param name="OutlineColor"> Outline Color </param>
        public static void drawHollowRectangle(int posX, int posY, int widthX, int heightY, float OutlineThickness, Color OutlineColor)
        {
            RectangleShape HollowRect = new RectangleShape();

            HollowRect.FillColor        = Color.Transparent.Convert();
            HollowRect.Position         = new SFML.System.Vector2f(posX, posY);
            HollowRect.Size             = new SFML.System.Vector2f(widthX, heightY);
            HollowRect.OutlineThickness = OutlineThickness;
            HollowRect.OutlineColor     = OutlineColor.Convert();

            CurrentRenderTarget.DrawSFML(HollowRect);
        }
Example #10
0
        /// <summary>
        /// Draws a Rectangle to the current RenderTarget
        /// </summary>
        /// <param name="posX">Pos X of rectangle </param>
        /// <param name="posY"> Pos Y of rectangle </param>
        /// <param name="WidthX"> Width X of rectangle </param>
        /// <param name="HeightY"> Height Y of rectangle </param>
        /// <param name="Color"> Fill Color </param>
        public static void drawRectangle(float posX, float posY, float WidthX, float HeightY, Color Color)
        {
            RectangleShape rectangle = new RectangleShape();

            rectangle.Position  = new SFML.System.Vector2f(posX, posY);
            rectangle.Size      = new SFML.System.Vector2f(WidthX, HeightY);
            rectangle.FillColor = Color.Convert();

            CurrentRenderTarget.DrawSFML(rectangle);
        }
Example #11
0
 public static void ClearCurrentRendertarget(Color color)
 {
     CurrentRenderTarget.Clear(color);
 }