/// <summary> /// Helper to load Settings and populate the form elements /// <see cref="Settings"/> /// </summary> public void LoadSettings() { // line LineThickness = Settings.LineThickness; tB_LineThickness.Text = LineThickness.ToString(); LineMaxLength = Settings.LineMaxLength; tB_LineMaxLength.Text = LineMaxLength.ToString(); LineDividerLengthFactor = Settings.LineSubdividerLengthFactor; tB_LineDividerLengthFactor.Text = LineDividerLengthFactor.ToString(); ScaleStyle = Settings.Style; lB_ScaleStyle.DataStore = Enum.GetNames(typeof(ScaleOverlay.ScaleStyle)); // text TextHeight = Settings.TextHeight; tB_TextHeight.Text = TextHeight.ToString(); TextFont = Settings.TextFont; fP_TextFont.Value = TextFont.ToEtoFont(); // position OffsetX = Settings.OffsetX; tB_OffsetX.Text = OffsetX.ToString(); OffsetY = Settings.OffsetY; tB_OffsetY.Text = OffsetY.ToString(); TextGap = Settings.TextGap; tB_TextGap.Text = TextGap.ToString(); // color LineColor = Settings.LineColor; btn_LineColor.BackgroundColor = LineColor.ToEto(); TextColor = Settings.TextColor; btn_TextColor.BackgroundColor = TextColor.ToEto(); }
public override string[] ToStringArray() { string[] a = new string[13]; a[0] = ID.ToString(); a[1] = GameType.ToString(); a[2] = Type.ToString(); a[3] = SubType.ToString(); a[4] = Group.ToString(); a[5] = TargetGroup.ToString(); /*a[5] = Bytes[6].ToString(); * a[6] = Bytes[7].ToString(); * a[7] = Bytes[8].ToString(); * a[8] = Bytes[9].ToString(); * a[9] = Bytes[10].ToString(); * a[10] = Bytes[11].ToString();*/ a[6] = NextID.ToString(); a[7] = Value.ToString();// Bytes[14].ToString(); //a[7] = Bytes[15].ToString(); a[8] = X.ToString(); a[9] = Y.ToString(); a[10] = OffsetX.ToString(); a[11] = OffsetY.ToString(); a[12] = Offset.ToString(); return(a); }
public void DrawMarkers(RenderWindow window) { int nMarkers = 0; //Always draw the origin marker (Year 0) at the X Offset DrawMarker(window, OffsetX, "0"); nMarkers++; //Go Right from the Origin Marker int i = 1; while (OffsetX + i * MarkerInterval < window.Size.X) { if (OffsetX + i * MarkerInterval > 0) { DrawMarker(window, OffsetX + i * MarkerInterval, i.ToString()); nMarkers++; } i++; } //Go Left from the Origin Marker i = -1; while (OffsetX + i * MarkerInterval > 0) { if (OffsetX + i * MarkerInterval < window.Size.X) { DrawMarker(window, OffsetX + i * MarkerInterval, i.ToString()); nMarkers++; } i--; } //Display num of markers and OffsetX at top of screen for testing Text text = new Text("Markers: " + nMarkers.ToString(), font); text.Position = new Vector2f(window.Size.X - text.GetLocalBounds().Width - 20, 20); text.FillColor = Color.Black; window.Draw(text); Text text2 = new Text("X Offset: " + OffsetX.ToString(), font); text2.Position = new Vector2f(window.Size.X - text.GetLocalBounds().Width - 40, 80); text2.FillColor = Color.Black; window.Draw(text2); }
private void tB_OffsetX_TextChanged(object sender, EventArgs e) { if (int.TryParse(tB_OffsetX.Text, out int result)) { OffsetX = result; if (result < Settings.MinOffsetX) { OffsetX = Settings.MinOffsetX; } if (result > Settings.MaxOffsetX) { OffsetX = Settings.MaxOffsetX; } tB_OffsetX.Text = OffsetX.ToString(); } }
public override string ToString() { if (IsIdentity) { return(this.GetType().Name + "=Identity"); } else { return(string.Format(this.GetType().Name + "{{M11={0} M12={1} M21={2} M22={3} OffsetX={4} OffsetY={5}}}", M11.ToString(CultureInfo.InvariantCulture), M12.ToString(CultureInfo.InvariantCulture), M21.ToString(CultureInfo.InvariantCulture), M22.ToString(CultureInfo.InvariantCulture), OffsetX.ToString(CultureInfo.InvariantCulture), OffsetY.ToString(CultureInfo.InvariantCulture))); } }