private void StartPlayerTurn() { float camheight = Camera.main.orthographicSize * 2.0f; float camwidth = Camera.main.aspect * camheight; float camx = Camera.main.transform.position.x - camwidth / 2; float camy = Camera.main.transform.position.y + camheight / 2; Button l = new Button(); l.SetText("Attack"); l.SetMessageDetails(STANDARD_ACTION, STANDARD_ATTACK); l.SetPosition(camx + (camwidth / 2) - 256.0f, camy - camheight + 64.0f * 3 + 16.0f); l.SetScale(8.0f, 1.5f); standard_actions.Add(l); l = new Button(); l.SetText("Abilities"); l.SetMessageDetails(STANDARD_ACTION, STANDARD_ABILITY); l.SetPosition(camx + (camwidth / 2), camy - camheight + 64.0f * 3 + 16.0f); l.SetScale(8.0f, 1.5f); standard_actions.Add(l); l = new Button(); l.SetText("Defend"); l.SetMessageDetails(STANDARD_ACTION, STANDARD_DEFEND); l.SetPosition(camx + (camwidth / 2) + 256.0f, camy - camheight + 64.0f * 3 + 16.0f); l.SetScale(8.0f, 1.5f); standard_actions.Add(l); waiting_ability = true; waiting_target = true; waiting = true; MessageHandler.ClearMessages(); }
private void SetUp() { text_obj = new TextField(); text_obj.SetText(data.text); text_obj.SetPosition(-8.0f, 4.0f); text_obj.SetLineWidth(160); if (data.actions.Count <= 0) { Button b = new Button(); b.SetMessageDetails("finish", 0); b.SetText("Continue"); b.SetScale(1.0f, 0.5f); b.SetPosition(0.0f, 2.0f); buttons.Add(b); } else { foreach (Action a in data.actions) { Button b = new Button(); b.SetMessageDetails("event", a.index); b.SetText(a.text); b.SetScale(1.0f, 0.5f); b.SetPosition(0.0f, 2.0f + 0.5f * (float)-a.index); b.SetLineWidth(120); if (a.special) { b.SetTextColor(Color.cyan); } buttons.Add(b); } } }