public void Setup(Vector3 pos, bool onGameScreen = false) { GetPersistData(); writer = new WritingWriter(); textBox = GetGameObject(pos, "Text Box", Resources.Load <Sprite>(SpritePaths.DialogBox), false, "Cover HUD Dialog Box"); if (onGameScreen) { textBoxScale = 0.4f; textBox.transform.localScale = new Vector3(textBoxScale, 0.4f); } else { textBoxScale = 1.0f; } bounds = new Vector3(textBox.renderer.bounds.size.x * 0.94f, textBox.renderer.bounds.size.y * 0.66f); Vector3 textpos = textBox.transform.position; textpos.x -= 8.7f * (onGameScreen?0.4f:1.0f); textpos.y += 1.5f * (onGameScreen?0.4f:1.0f); FontData f = PD.mostCommonFont.Clone(); f.align = TextAlignment.Left; f.anchor = TextAnchor.UpperLeft; f.layerName = "Cover HUD Dialog Text"; f.scale = onGameScreen?0.04f:0.1f; nameText = GetMeshText(textpos, "Ass", f); leftx = textpos.x; rightx = 5.5f * (onGameScreen?0.4f:1.0f); textpos.y -= 0.6f * (onGameScreen?0.4f:1.0f); textpos.x += 0.025f; f.scale = onGameScreen?0.04f:0.10f; dialogText = GetMeshText(textpos, "", f); }
public void Init(TextMesh t, GameObject container) { GetPersistData(); tutorialText = t; writer = new WritingWriter(); bounds = new Vector2(1.75f, 2.0f); highlight = GetGameObject(Vector3.zero, "Tutorial Highlight", Resources.Load <Sprite>(SpritePaths.WhiteSingle), false, "HUDText"); instructions = (GetXMLHead("/tutorial", "instructions")).SelectNodes("instruction"); tutState = -1; negativeonetimer = 80; }