Make goals look nice.
This commit is contained in:
parent
bff66d9110
commit
6b17d4a60d
2 changed files with 8 additions and 5 deletions
Binary file not shown.
|
@ -9,7 +9,8 @@ using UnityEngine.UI;
|
|||
namespace PedometerU.Tests {
|
||||
|
||||
public class GetGoals : MonoBehaviour {
|
||||
|
||||
|
||||
public Image background;
|
||||
public Text goalText;
|
||||
public string currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||
public string goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||
|
@ -18,7 +19,7 @@ public class GetGoals : MonoBehaviour {
|
|||
//Progress Bar...
|
||||
public float barDisplay; //current progress
|
||||
private Vector2 barPos;
|
||||
private Vector2 barSize = new Vector2(227,20);
|
||||
private Vector2 barSize = new Vector2(725, 39);
|
||||
|
||||
//Pedometer
|
||||
private Pedometer pedometer;
|
||||
|
@ -76,8 +77,9 @@ public class GetGoals : MonoBehaviour {
|
|||
|
||||
//goalText.text = prefKey;
|
||||
goalText.color = new Color(0f, 0f, 0f);
|
||||
Debug.Log(goalText.transform.position.x.ToString() + " " + goalText.transform.position.y.ToString());
|
||||
barPos = new Vector2(goalText.transform.position.x, goalText.transform.position.y);
|
||||
Debug.Log(background.rectTransform.anchoredPosition.x.ToString() + " " + background.rectTransform.anchoredPosition.y.ToString());
|
||||
|
||||
barPos = new Vector2(background.transform.position.x, 2135 - background.transform.position.y);
|
||||
|
||||
currentDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||
goalDayStr = System.DateTime.Now.ToString("MM/dd/yyyy");
|
||||
|
@ -109,7 +111,7 @@ public class GetGoals : MonoBehaviour {
|
|||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
void OnGUI() {
|
||||
//draw the background:
|
||||
GUI.BeginGroup(new Rect(barPos.x, barPos.y, barSize.x, barSize.y));
|
||||
|
@ -122,6 +124,7 @@ public class GetGoals : MonoBehaviour {
|
|||
GUI.EndGroup();
|
||||
}
|
||||
|
||||
|
||||
void Update() {
|
||||
//needs current points counting toward this goal (daily?)
|
||||
//needs the total required points for this goal
|
||||
|
|
Reference in a new issue