示例#1
0
 Constants( )
 {
     //initialize all settings with default values
     ColorSelectionFirst = new Color( 255, 255, 0, 255 ) ;
     ColorSelectionRest = new Color( 255, 128, 0, 255 ) ;
     EnableHighlightOnMouseOver = true ;
     ColorHighlight = new Color( 255, 0, 0, 228 ) ;
     ColorBackground = new Color( 100, 149, 237, 255 ) ;
     ColorSelectionBox = new Color( 255, 255, 255 ) * .25f ;
     ColorPrimitives = new Color( 192, 0, 192, 145 ) ;
     ColorTextureTransparent = new Color( 255, 0, 255, 255 ) ;
     DefaultPathItemLineWidth = 4 ;
     DefaultContentRootFolder = new PathToFolder{AbsolutePath = @"C:\" };
     CameraSpeed = 500 ;
     CameraFastSpeed = 2000 ;
     DefaultTextureOrigin = InternalPoint.Middle ;
     WorldOriginColor = new Color( 255, 255, 255, 255 ) ;
     WorldOriginLineThickness = 2 ;
     GridColor = new Color( 192, 192, 192, 120 ) ;
     GridLineThickness = 1 ;
     GridNumberOfGridLines = 500 ;
     GridSpacing = new Vector2( 64, 64 ) ;
 }
示例#2
0
        /// <summary>
        /// Creates a relative path from one file or folder to another.
        /// </summary>
        /// <param name="fromPath">Contains the directory that defines the start of the relative path.</param>
        /// <param name="toPath">Contains the path that defines the endpoint of the relative path.</param>
        /// <returns>The relative path from the start directory to the end path.</returns>
        /// <exception cref="ArgumentNullException"></exception>
        static string makeRelativePath( PathToFolder fromPath, string toPath )
        {
            var fromUri = new Uri( fromPath.AbsolutePath ) ;
            var toUri = new Uri( toPath ) ;

            Uri relativeUri = fromUri.MakeRelativeUri( toUri ) ;
            string relativePath = Uri.UnescapeDataString( relativeUri.ToString( ) ) ;

            return relativePath.Replace( '/', Path.DirectorySeparatorChar ) ;
        }