24/01/18 7:55
Thejuster
questa funzione che hai appena scritto è javascript.
Interpretato dal motore.
questa funzione this.bitmap.[b]DrawText va a richiamare la funzione che stiamo trattando nel topic
e la funzione fa unicamente quello nulla di piu
Interpretato dal motore.
questa funzione this.bitmap.[b]DrawText va a richiamare la funzione che stiamo trattando nel topic
e la funzione fa unicamente quello nulla di piu
/// <summary> /// Disegna del testo in specifiche coordinate /// </summary> /// <param name="x">X</param> /// <param name="y">Y</param> /// <param name="text">Testo</param> /// <param name="color">Colore Opzionale</param> public void draw_text(int x, int y, string text,int color = 0) { StringBuilder sb = new StringBuilder(); if (text.Contains("?c[")) { string[] t = Regex.Split(text, @"\?c\[\w+\]"); string[] a = Regex.Split(text, @"\[(.*?)\]"); for (int i = 0; i < a.Length; i++) { if (a[i].Contains("?c")) { a[i] = a[i].Replace("?c", ""); } } int colore = 0; int newx; float tot = 0f; for (int i = 0; i < a.Length-1; i++) { int.TryParse(a[i], out colore); if (colore == 0) { char[] arr = a[i].ToCharArray(); for (int j = 0; j < arr.Length; j++) { tot += x + (j * 0.0002f) - 25; spriteBatch.DrawString(debugFont, arr[j].ToString(), new Vector2(tot, y), Color.White); } continue; } if (colore == 10) { char[] arr = a[i + 1].ToCharArray(); for (int j = 0; j < arr.Length; j++) { tot += x + (j * 0.0002f) - 25; spriteBatch.DrawString(debugFont, arr[j].ToString(), new Vector2(tot, y), Color.Gold); } } } }
mire.forumfree.it/ - Mire Engine
C# UI Designer
C# UI Designer