Esempio n. 1
0
        /// <summary>
        /// Draw the ruler on the screen
        /// </summary>
        public void Draw()
        {
            if (!Properties.Settings.Default.showScaleRuler)
            {
                return;
            }
            if (Properties.Settings.Default.useMilesNotMeters != useMilesNotMeters)
            {
                SetCurrentRuler(pixelsPerMeter); // Only do this when needed
            }

            string scaleText = " (" + (1.0f / pixelsPerMeter).ToString(System.Globalization.CultureInfo.CurrentCulture) + "m/pixel)";

            Vector2 lowerRightPoint = new Vector2(lowerLeftPoint.X + fullPixelWidth, lowerLeftPoint.Y);
            Vector2 bigMarker       = new Vector2(0, -halfFontHeight);
            Vector2 smallMarker     = new Vector2(0, -(int)(halfFontHeight / 2));
            Color   color           = DrawColors.colorsNormal.Text;

            BasicShapes.DrawLine(1, color, lowerLeftPoint, lowerRightPoint);
            BasicShapes.DrawLine(1, color, lowerLeftPoint, lowerLeftPoint + bigMarker);
            BasicShapes.DrawLine(1, color, lowerRightPoint, lowerRightPoint + bigMarker);
            BasicShapes.DrawString(lowerRightPoint + bigMarker, color, currentRuler.text + scaleText);
            for (int i = 1; i < currentRuler.subMarkers; i++)
            {
                Vector2 smallMarkerPoint = new Vector2(lowerLeftPoint.X + fullPixelWidth * i / currentRuler.subMarkers, lowerLeftPoint.Y);
                BasicShapes.DrawLine(1, color, smallMarkerPoint, smallMarkerPoint + smallMarker);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Draw (print) the values of longitude and latitude
        /// </summary>
        /// <param name="mstsLocation">MSTS Location which to translate to real world coordinates</param>
        public void Draw(WorldLocation mstsLocation)
        {
            if (!Properties.Settings.Default.showLonLat)
            {
                return;
            }

            double latitude  = 1f;
            double longitude = 1f;

            worldLoc.ConvertWTC(mstsLocation.TileX, mstsLocation.TileZ, mstsLocation.Location, ref latitude, ref longitude);
            string latitudeDegrees  = MathHelper.ToDegrees((float)latitude).ToString("F5", System.Globalization.CultureInfo.CurrentCulture);
            string longitudeDegrees = MathHelper.ToDegrees((float)longitude).ToString("F5", System.Globalization.CultureInfo.CurrentCulture);
            string locationText     = String.Format(System.Globalization.CultureInfo.CurrentCulture,
                                                    "Lon = {0}; Lat = {1}", longitudeDegrees, latitudeDegrees);

            BasicShapes.DrawString(lowerLeft, DrawColors.colorsNormal.Text, locationText);
        }
Esempio n. 3
0
 /// <summary>
 /// This simply draws the debug string.
 /// </summary>
 private void Draw()
 {
     BasicShapes.DrawString(startLocation, Color.Black, DrawString);
 }