當前位置: 首頁>>代碼示例>>C#>>正文


C# Point2D.Clone2D方法代碼示例

本文整理匯總了C#中Server.Point2D.Clone2D方法的典型用法代碼示例。如果您正苦於以下問題:C# Point2D.Clone2D方法的具體用法?C# Point2D.Clone2D怎麽用?C# Point2D.Clone2D使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Point2D的用法示例。


在下文中一共展示了Point2D.Clone2D方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CompileSecondHand

		protected virtual void CompileSecondHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/second",
				() =>
				{
					var sa = 2.0f * Math.PI * Time.Seconds / 60.0f;
					var shp = center.Clone2D((int)(Radius * Math.Sin(sa)), (int)(-Radius * Math.Cos(sa)));

					AddLine(center, shp, ColorSecondHand, 1);
				});
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:12,代碼來源:AnalogClock.cs

示例2: CompileHourHand

		protected virtual void CompileHourHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/hour",
				() =>
				{
					var ha = 2.0f * Math.PI * (Time.Hours + Time.Minutes / 60.0f) / 12.0f;
					var hhp = center.Clone2D((int)(Radius * Math.Sin(ha) / 1.5f), (int)(-Radius * Math.Cos(ha) / 1.5f));

					AddLine(center, hhp, ColorHourHand, 3);
				});
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:12,代碼來源:AnalogClock.cs

示例3: CompileMinuteHand

		protected virtual void CompileMinuteHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/minute",
				() =>
				{
					var ma = 2.0f * Math.PI * (Time.Minutes + Time.Seconds / 60.0f) / 60.0f;
					var mhp = center.Clone2D((int)(Radius * Math.Sin(ma)), (int)(-Radius * Math.Cos(ma)));

					AddLine(center, mhp, ColorMinuteHand, 3);
				});
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:12,代碼來源:AnalogClock.cs

示例4: CompileSecondHand

		protected virtual void CompileSecondHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/second",
				() =>
				{
					var sa = 2.0f * Math.PI * Time.Seconds / 60.0f;
					var shp = center.Clone2D((int)(Radius * Math.Sin(sa)), (int)(-Radius * Math.Cos(sa)));

					foreach (var p in center.GetLine2D(shp))
					{
						AddHtml(p.X, p.Y, 1, 1, " ".WrapUOHtmlBG(ColorSecondHand), false, false);
					}
				});
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:15,代碼來源:AnalogClock.cs

示例5: CompileMinuteHand

		protected virtual void CompileMinuteHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/minute",
				() =>
				{
					var ma = 2.0f * Math.PI * (Time.Minutes + Time.Seconds / 60.0f) / 60.0f;
					var mhp = center.Clone2D((int)(Radius * Math.Sin(ma)), (int)(-Radius * Math.Cos(ma)));

					foreach (var p in center.GetLine2D(mhp))
					{
						AddHtml(p.X - 1, p.Y - 1, 3, 3, " ".WrapUOHtmlBG(ColorMinuteHand), false, false);
					}
				});
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:15,代碼來源:AnalogClock.cs

示例6: CompileHourHand

		protected virtual void CompileHourHand(SuperGumpLayout layout, Point2D center)
		{
			layout.Add(
				"clock/hand/hour",
				() =>
				{
					var ha = 2.0f * Math.PI * (Time.Hours + Time.Minutes / 60.0f) / 12.0f;
					var hhp = center.Clone2D((int)(Radius * Math.Sin(ha) / 1.5f), (int)(-Radius * Math.Cos(ha) / 1.5f));

					foreach (var p in center.GetLine2D(hhp))
					{
						AddHtml(p.X - 1, p.Y - 1, 3, 3, " ".WrapUOHtmlBG(ColorHourHand), false, false);
					}
				});
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:15,代碼來源:AnalogClock.cs

示例7: AppendTo

		public override void AppendTo(IGumpWriter disp)
		{
			var first = true;

			if (_Background)
			{
				disp.AppendLayout(_Layout1A);
				disp.AppendLayout(_X);
				disp.AppendLayout(_Y);
				disp.AppendLayout(1417);

				if (_BackgroundHue > 0)
				{
					disp.AppendLayout(_Layout1Hue);
					disp.AppendLayoutNS(FixHue(_BackgroundHue));
				}

				first = false;
			}

			if (_Face)
			{
				disp.AppendLayout(first ? _Layout1A : _Layout1B);
				disp.AppendLayout(_X + 33);
				disp.AppendLayout(_Y + 33);
				disp.AppendLayout(1210);

				if (_FaceHue > 0)
				{
					disp.AppendLayout(_Layout1Hue);
					disp.AppendLayoutNS(FixHue(_FaceHue));
				}

				first = false;
			}

			if (_Numbers)
			{
				for (var number = 1; number <= 12; number++)
				{
					AppendTo(disp, ref first, number, _NumbersColor);
				}
			}

			var center = new Point2D(_X + 40, _Y + 40);

			if (_Hours)
			{
				var ha = 2.0f * Math.PI * (_Time.Hour + _Time.Minute / 60.0f) / 12.0f;
				var hl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ha) / 1.5f), (int)(-40 * Math.Cos(ha) / 1.5f)));

				AppendTo(disp, ref first, hl, 3, _HoursColor);
			}

			if (_Minutes)
			{
				var ma = 2.0f * Math.PI * (_Time.Minute + _Time.Second / 60.0f) / 60.0f;
				var ml = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ma)), (int)(-40 * Math.Cos(ma))));

				AppendTo(disp, ref first, ml, 3, _MinutesColor);
			}

			if (_Seconds)
			{
				var sa = 2.0f * Math.PI * _Time.Second / 60.0f;
				var sl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(sa)), (int)(-40 * Math.Cos(sa))));

				AppendTo(disp, ref first, sl, 1, _SecondsColor);
			}

			if (first)
			{
				disp.AppendLayout(_Layout2A);
				disp.AppendLayout(_X);
				disp.AppendLayout(_Y);
				disp.AppendLayout(Width);
				disp.AppendLayout(Height);
				disp.AppendLayout(Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
				disp.AppendLayout(false);
				disp.AppendLayout(false);
			}
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:82,代碼來源:GumpClock.cs

示例8: Compile

		public override string Compile()
		{
			var compiled = String.Empty;

			if (_Background)
			{
				if (_BackgroundHue <= 0)
				{
					compiled += String.Format(_Format1A, _X, _Y, 1417);
				}
				else
				{
					compiled += String.Format(_Format1B, _X, _Y, 1417, FixHue(_BackgroundHue));
				}
			}

			if (_Face)
			{
				if (_FaceHue <= 0)
				{
					compiled += String.Format(_Format1A, _X + 33, _Y + 33, 1210);
				}
				else
				{
					compiled += String.Format(_Format1B, _X + 33, _Y + 33, 1210, FixHue(_FaceHue));
				}
			}

			if (_Numbers)
			{
				for (var number = 1; number <= 12; number++)
				{
					compiled += Compile(number, _NumbersColor);
				}
			}

			var center = new Point2D(_X + 40, _Y + 40);

			if (_Hours)
			{
				var ha = 2.0f * Math.PI * (_Time.Hour + _Time.Minute / 60.0f) / 12.0f;
				var hl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ha) / 1.5f), (int)(-40 * Math.Cos(ha) / 1.5f)));

				compiled += Compile(hl, 3, _HoursColor);
			}

			if (_Minutes)
			{
				var ma = 2.0f * Math.PI * (_Time.Minute + _Time.Second / 60.0f) / 60.0f;
				var ml = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(ma)), (int)(-40 * Math.Cos(ma))));

				compiled += Compile(ml, 3, _MinutesColor);
			}

			if (_Seconds)
			{
				var sa = 2.0f * Math.PI * _Time.Second / 60.0f;
				var sl = center.GetLine2D(center.Clone2D((int)(40 * Math.Sin(sa)), (int)(-40 * Math.Cos(sa))));

				compiled += Compile(sl, 1, _SecondsColor);
			}

			if (String.IsNullOrWhiteSpace(compiled))
			{
				compiled = String.Format(_Format2, _X, _Y, Width, Height, Parent.Intern(" ".WrapUOHtmlBG(Color.Transparent)));
			}

			return compiled;
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:69,代碼來源:GumpClock.cs


注:本文中的Server.Point2D.Clone2D方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。