public Entity CreateMovingTextlet(Vector2 pos, string text) { var t = TTFactory.CreateTextlet(text); t.GetComponent <PositionComp>().Position2D = pos; t.GetComponent <DrawComp>().DrawColor = Color.Black; t.GetComponent <VelocityComp>().Velocity = 0.2f * new Vector3((float)rnd.NextDouble() - 0.5f, (float)rnd.NextDouble() - 0.5f, 0f); t.GetComponent <ScaleComp>().Scale = 0.5; return(t); }
public Entity CreateTextlet(Vector2 pos, string text, Color col) { var txt = TTFactory.CreateTextlet(text); txt.GetComponent <PositionComp>().Position2D = pos; txt.GetComponent <PositionComp>().Z = 0f + 0.1f * ((float)rnd.NextDouble()); // random Z position txt.GetComponent <DrawComp>().DrawColor = col; txt.GetComponent <ScaleComp>().Scale = 0.8; return(txt); }
/// <summary> /// Creates a new FrameRateCounter. TODO: screen position set. /// </summary> /// <returns></returns> public static Entity Create(Color textColor) { var e = TTFactory.CreateTextlet("##"); e.GetComponent <PositionComp>().Position = new Vector3(0.03f, 0.01f, 0f); e.GetComponent <DrawComp>().DrawColor = textColor; var m = new ScriptComp(new FrameRateCounter(e.GetComponent <TextComp>())); e.AddComponent(m); e.Refresh(); return(e); }