Beispiel #1
0
 /// <summary>
 /// Constructs a new <see cref="UVRectangle"/> by copying its values from a template.
 /// </summary>
 /// <param name="template">The UVRectangle to copy values from</param>
 public UVRectangle(UVRectangle template)
 {
     this.TopLeft     = template.TopLeft;
     this.TopRight    = template.TopRight;
     this.BottomLeft  = template.BottomLeft;
     this.BottomRight = template.BottomRight;
 }
Beispiel #2
0
        /// <summary>
        /// Returns a new <see cref="UVRectangle"/> scaled by multiplying all coordinates with the given scalar.
        /// </summary>
        /// <param name="scale">The scalar</param>
        public UVRectangle ReScaled(float scale)
        {
            UVRectangle ret = new UVRectangle(this);

            ret.ReScale(scale);
            return(ret);
        }
Beispiel #3
0
        /// <summary>
        /// Returns a new <see cref="UVRectangle"/> rotated by a given angle around a given point.
        /// </summary>
        /// <param name="angle">The angle by which to rotate</param>
        /// <param name="center">The point around which to rotate</param>
        public UVRectangle Rotated(float angle, Vector2 center)
        {
            UVRectangle ret = new UVRectangle(this);

            ret.Rotate(angle, center);
            return(ret);
        }
Beispiel #4
0
        /// <summary>
        /// Returns a new <see cref="UVRectangle"/> flipped vertically.
        /// </summary>
        public UVRectangle FlippedV()
        {
            UVRectangle ret = new UVRectangle(this);

            ret.FlipV();
            return(ret);
        }
Beispiel #5
0
 /// <summary>
 /// Constructs a new <see cref="UVRectangle"/> by copying its values from a template.
 /// </summary>
 /// <param name="template">The UVRectangle to copy values from</param>
 public UVRectangle(UVRectangle template)
 {
     this.TopLeft = template.TopLeft;
     this.TopRight = template.TopRight;
     this.BottomLeft = template.BottomLeft;
     this.BottomRight = template.BottomRight;
 }
Beispiel #6
0
 public UVQuadGeometry(IndexedSurface <TVertexData> surface)
 {
     this.Size      = Vector2.One;
     this.LineWidth = 1;
     this.UV        = UVRectangle.Default;
     this.Surface   = surface;
 }
Beispiel #7
0
 /// <summary>
 /// Returns a new <see cref="UVRectangle"/> scaled by multiplying all coordinates with the given scalar.
 /// </summary>
 /// <param name="scale">The scalar</param>
 public UVRectangle ReScaled(float scale)
 {
     UVRectangle ret = new UVRectangle(this);
     ret.ReScale(scale);
     return ret;
 }
Beispiel #8
0
 /// <summary>
 /// Returns a new <see cref="UVRectangle"/> flipped vertically.
 /// </summary>
 public UVRectangle FlippedV()
 {
     UVRectangle ret = new UVRectangle(this);
     ret.FlipV();
     return ret;
 }
Beispiel #9
0
 /// <summary>
 /// Returns a new <see cref="UVRectangle"/> rotated by a given angle around a given point.
 /// </summary>
 /// <param name="angle">The angle by which to rotate</param>
 /// <param name="center">The point around which to rotate</param>
 public UVRectangle Rotated(float angle, Vector2 center)
 {
     UVRectangle ret = new UVRectangle(this);
     ret.Rotate(angle, center);
     return ret;
 }