Beispiel #1
0
        /// <summary>
        /// Draw the sprite projected on a rectangle.
        /// </summary>
        public void Draw(ComplexRectangle rect, int frameIndex = 0, int depth = 0)
        {
            if (!Loaded)
                throw new NotLoadedException();

            Rectangle sourceRect = new Rectangle(GetIndexLocation(frameIndex), FrameSize);
            DrawX.DrawJobs.Add(new TextureDrawJob(depth, rect.GetEnclosingRectangle(), TextureHandle, sourceRect, rect));
        }
        /// <summary>
        /// Texture job.
        /// </summary>
        public TextureDrawJob(int depth, Rectangle area, IntPtr texture, Rectangle sourceRect, ComplexRectangle destRect)
            : this()
        {
            Texture    = texture;
            SourceRect = sourceRect;
            DestRect   = destRect;

            Depth = depth;
            Area  = area;
        }
        /// <summary>
        /// Texture job.
        /// </summary>
        public TextureDrawJob(int depth, Rectangle area, IntPtr texture, Rectangle sourceRect, ComplexRectangle destRect)
            : this()
        {
            Texture = texture;
            SourceRect = sourceRect;
            DestRect = destRect;

            Depth = depth;
            Area = area;
        }
Beispiel #4
0
        public void Draw(ComplexRectangle rect, int frameIndex = 0, int depth = 0)
        {
            if (!Loaded)
            {
                throw new NotLoadedException();
            }

            Rectangle sourceRect = new Rectangle(GetIndexLocation(frameIndex), FrameSize);

            DrawX.DrawJobs.Add(new TextureDrawJob(depth, rect.GetEnclosingRectangle(), TextureHandle, sourceRect, rect));
        }
 public ComplexRectangle(ComplexRectangle rect)
     : this(rect._Position, rect._Size, rect._origin, rect._Rotation)
 {
 }
 public ComplexRectangle(ComplexRectangle rect)
     : this(rect._Position, rect._Size, rect._Origin, rect._Rotation)
 {
 }