public static void UnMouseOver() { NodoMouse = null; MOTexts = null; }
public static void SelectNodo(TDrawNodo Nodo) { if (Nodo != null) { NodoSelecionado = Nodo.InfoNodo; string NomeD = NodoSelecionado.Nome; if (NomeD != null) { NSTextPos = Vector2.Transform(Nodo.Pos, AppGraphics.Camera.get_transformation()); NSTextSize = new Vector2(0, 0); NSTextPos.Y += (AppGraphics.DefaultNodeSize * 0.5f * AppGraphics.Camera.Zoom); NSTexts = new List<string>(); string[] NomeDSS = NomeD.Split(' '); NSTexts.Add(""); int NomeDSA = 0; NSTextSize.Y += GUI.Fonts[2].MeasureString(NomeD).Y; int i = 0; bool há = false; int max = 3; while ((!há) && (max > 0)) { i = 0; while ((i < NomeDSS.Length)) { if (NomeDSS[i].Length >= max) { NSTexts[NomeDSA] += NomeDSS[i] + " "; Vector2 sSize = GUI.Fonts[2].MeasureString(NSTexts[NomeDSA]); if (sSize.X > NSTextSize.X) NSTextSize.X = sSize.X; if (i < NomeDSS.Length - 1) if ((GUI.Fonts[2].MeasureString(NSTexts[NomeDSA] + NomeDSS[i + 1]).X > (AppGraphics.ScreenCenter.X * 2) - NSTextPos.X - Renderer.RightPanel.Size.X) || (GUI.Fonts[2].MeasureString(NSTexts[NomeDSA] + NomeDSS[i + 1]).X > Constants.MaxSelectedNodeSizeAlwaysText)) { NomeDSA++; NSTexts.Add(""); há = true; } } i++; if ((NSTexts.Count >= Constants.MaxSelectedNodeLinesAlwaysText)) { i = NomeDSS.Length + 1; } } max--; } NSTextSize.Y = 0; for (int j = 0; j < NSTexts.Count; j++) if ((NSTexts[j] != "") && (NSTexts[j] != " ")) NSTextSize.Y += GUI.Fonts[2].MeasureString(NSTexts[j]).Y; NSTextPos.X -= NSTextSize.X * 0.5f; } else MouseNodeHandler.NSTexts = new List<string>(); } }
public static void UnMouseOver(TDrawNodo Nodo) { if (NodoMouse == Nodo) NodoMouse = null; }
public static void MouseOverNodo(TDrawNodo Nodo) { NodoMouse = Nodo; string NomeD = NodoMouse.InfoNodo.Nome; if (NomeD != null) { MOTextPos = Vector2.Transform(NodoMouse.Pos, AppGraphics.Camera.get_transformation()); MOTextSize = new Vector2(0, 0); MOTextPos.Y += (AppGraphics.DefaultNodeSize * 0.5f * AppGraphics.Camera.Zoom); MOTexts = new List<string>(); string[] NomeDSS = NomeD.Split(' '); MOTexts.Add(""); int NomeDSA = 0; MOTextSize.Y += GUI.Fonts[2].MeasureString(NomeD).Y; for (int i = 0; i < NomeDSS.Length; i++) { MOTexts[NomeDSA] += NomeDSS[i] + " "; Vector2 sSize = GUI.Fonts[2].MeasureString(MOTexts[NomeDSA]); if (sSize.X > MOTextSize.X) MOTextSize.X = sSize.X; if (i < NomeDSS.Length - 1) if (GUI.Fonts[2].MeasureString(MOTexts[NomeDSA] + NomeDSS[i + 1]).X > (AppGraphics.ScreenCenter.X * 2) - MOTextPos.X - Renderer.RightPanel.Size.X) { NomeDSA++; MOTexts.Add(""); MOTextSize.Y += sSize.Y; } } MOTextPos.X -= MOTextSize.X * 0.5f; } else MouseNodeHandler.MOTexts = new List<string>(); }