示例#1
0
		protected virtual void RenderProgress(DrawArgs drawArgs)
		{

			drawArgs.device.SetTransform(TransformState.World, Matrix.Translation(
				(float)-drawArgs.WorldCamera.ReferenceCenter.X,
				(float)-drawArgs.WorldCamera.ReferenceCenter.Y,
				(float)-drawArgs.WorldCamera.ReferenceCenter.Z
			));

            this.device.SetRenderState(RenderState.ZEnable , false);
			double centerLat = 0.5 * (this.maxLat + this.minLat);
			double centerLon = 0.5 * (this.maxLon + this.minLon);

			Vector3 v = MathEngine.SphericalToCartesian(centerLat, centerLon, this.layerRadius);

			if(drawArgs.WorldCamera.ViewFrustum.ContainsPoint(v) && 
				MathEngine.SphericalDistanceDegrees(centerLat, centerLon, drawArgs.WorldCamera.Latitude.Degrees, drawArgs.WorldCamera.Longitude.Degrees) < 2 * drawArgs.WorldCamera.ViewRange.Degrees
				)
			{
				v.Project(drawArgs.device.Viewport, drawArgs.device.GetTransform(TransformState.Projection), drawArgs.device.GetTransform(TransformState.View), drawArgs.device.GetTransform(TransformState.World));

				MenuUtils.DrawBox((int)v.X, (int)v.Y, 200, 40, 0.0f, this.progressBarBackColor, drawArgs.device);
				Vector2[] boxOutline = new Vector2[5];
				boxOutline[0].X = (int)v.X;
				boxOutline[0].Y = (int)v.Y;

				boxOutline[1].X = (int)v.X + 200;
				boxOutline[1].Y = (int)v.Y;
					
				boxOutline[2].X = (int)v.X + 200;
				boxOutline[2].Y = (int)v.Y + 40;

				boxOutline[3].X = (int)v.X;
				boxOutline[3].Y = (int)v.Y + 40;

				boxOutline[4].X = (int)v.X;
				boxOutline[4].Y = (int)v.Y;

				MenuUtils.DrawLine(boxOutline, this.progressBarOutlineColor, drawArgs.device);

				drawArgs.defaultDrawingFont.DrawText(null,
					"Downloading Remote Image...",
					new System.Drawing.Rectangle((int)v.X + 5, (int)v.Y + 5, 200, 50),
					FontDrawFlags.NoClip, this.textColor);

                this.DrawProgressBar(drawArgs, v.X + 100, v.Y + 30, 180, 10, World.Settings.downloadProgressColor);
			}

            this.device.SetRenderState(RenderState.ZEnable , true);
			drawArgs.device.SetTransform(TransformState.World, drawArgs.WorldCamera.WorldMatrix;
		}