예제 #1
0
        private static void DrawExtentBox(this SpriteBatch spriteBatch, IRectangularExtent extent, Color color, Matrix transformFromWorldToCamera)
        {
            for (int i = 0; i < extent.ReferenceRegion.NumSides; i++)
            {
                _extentTraceVertices[i] = extent.ReferenceRegion.Vertices[i];
            }

            for (int i = 0; i < extent.ReferenceRegion.NumSides; i++)
            {
                _extentTraceVertices[i] = Vector2.Transform(_extentTraceVertices[i], extent.TranslateFrom);
            }
            spriteBatch.DrawPolygon(_extentTraceVertices, 4, color, transformFromWorldToCamera);
        }
예제 #2
0
        public static void DrawKeyPoints(this SpriteBatch spriteBatch, IRectangularExtent extent, RenderParams renderParams, Matrix transformFromWorldToCamera)
        {
            ISprite marker;

            if (null != renderParams.GetTexture_MarkCenter)
            {
                marker = renderParams.GetTexture_MarkCenter();
                marker.RenderingExtent.Anchor = Vector2.Transform(extent.ReferenceRegion.Center, extent.TranslateFrom);
                DrawSprite(spriteBatch, marker, transformFromWorldToCamera);
            }
            if (null != renderParams.GetTexture_MarkOrigin)
            {
                marker = renderParams.GetTexture_MarkOrigin();
                marker.RenderingExtent.Anchor = Vector2.Transform(extent.Origin, extent.TranslateFrom);
                DrawSprite(spriteBatch, marker, transformFromWorldToCamera);
            }
            if (null != renderParams.GetTexture_MarkTopLeft)
            {
                marker = renderParams.GetTexture_MarkTopLeft();
                marker.RenderingExtent.Anchor = Vector2.Transform(extent.ReferenceTopLeft, extent.TranslateFrom);
                DrawSprite(spriteBatch, marker, transformFromWorldToCamera);
            }
        }
예제 #3
0
 private static void DrawExtentBox(this SpriteBatch spriteBatch, IRectangularExtent extent, Color color)
 {
     DrawExtentBox(spriteBatch, extent, color, Matrix.Identity);
 }