public static void ThrowTextMote(Vector3 loc, Map map, string text, Color color, float solidTime, float timeBeforeStartFadeout = -1f) { if (!loc.ShouldSpawnMotesAt(map) || map.moteCounter.SaturatedLowPriority) { return; } MoteText moteText = (MoteText)ThingMaker.MakeThing(TorannMagicDefOf.Mote_1sText, null); moteText.rotationRate = 0; moteText.exactPosition = loc; moteText.text = text; moteText.textColor = color; moteText.def.mote.solidTime = solidTime; moteText.SetVelocity(0, 0); GenSpawn.Spawn(moteText, loc.ToIntVec3(), map); }
public static void ThrowText(Vector3 loc, Map map, string text, Color color, float timeBeforeStartFadeout = -1f) { IntVec3 intVec = loc.ToIntVec3(); if (intVec.InBounds(map)) { MoteText moteText = (MoteText)ThingMaker.MakeThing(ThingDefOf.Mote_Text, null); moteText.exactPosition = loc; moteText.SetVelocity((float)Rand.Range(5, 35), Rand.Range(0.42f, 0.45f)); moteText.text = text; moteText.textColor = color; if (timeBeforeStartFadeout >= 0.0) { moteText.overrideTimeBeforeStartFadeout = timeBeforeStartFadeout; } GenSpawn.Spawn(moteText, intVec, map); } }