bool DrawUpButton() { return(Gu.Button( Gu.Left(GameConsts.Menu.UpButtonLeft), Gu.Top(GameConsts.Menu.UpButtonTop), Gu.Dim(GameConsts.Menu.UpButtonWidth), Gu.Dim(GameConsts.Menu.UpButtonHeight), Gu.Dim(GameConsts.Menu.UpButtonFontSize), "<<")); }
void DrawSignInBar() { // draw the sign-in bar (the white bar behind the sign in button) Rect r = new Rect(Gu.Left(0), Gu.Bottom(GameConsts.Menu.SignInBarY), (int)Util.Interpolate(0.0f, 0.0f, 1.0f, Screen.width, mTransition.NormalizedElapsed), Gu.Dim(GameConsts.Menu.SignInBarHeight)); GUI.DrawTexture(r, SignInBarTex); }
public void DrawPilotInfo() { Gu.SetColor(Color.black); PilotStats stats = GameManager.Instance.Progress.CurPilotStats; float fontSize = SmallFormat ? GameConsts.Menu.PilotInfoFontSizeSmall : GameConsts.Menu.PilotInfoFontSize; float y = SmallFormat ? GameConsts.Menu.PilotInfoYSmallFont : GameConsts.Menu.PilotInfoY; // show summary info string summary; if (GameManager.Instance.Progress.IsMaxLevel()) { summary = string.Format(Strings.ExpStringMaxLevel, stats.Level, stats.Title, GameManager.Instance.Progress.PilotExperience); } else { summary = string.Format(Strings.ExpString, stats.Level, stats.Title, GameManager.Instance.Progress.PilotExperience, GameManager.Instance.Progress.GetExpForNextLevel()); } if (ShowPilotLevel) { Gu.Label(Gu.Left(GameConsts.Menu.PilotInfoX), Gu.Top(y), Gu.Dim(fontSize), summary, false); } if (!SmallFormat) { int total = GameManager.Instance.Progress.TotalScore; int stars = GameManager.Instance.Progress.TotalStars; Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreLabelX), Gu.Top(GameConsts.Menu.TotalScoreLabelY), Gu.Dim(GameConsts.Menu.TotalScoreLabelFontSize), Strings.TotalScore); Gu.Label(Gu.Right(GameConsts.Menu.TotalScoreX), Gu.Top(GameConsts.Menu.TotalScoreY), Gu.Dim(GameConsts.Menu.TotalScoreFontSize), total.ToString("D7")); Gu.Label(Gu.Right(GameConsts.Menu.StarsX), Gu.Top(GameConsts.Menu.StarsY), Gu.Dim(GameConsts.Menu.StarsFontSize), string.Format(Strings.TotalStarsFmt, stars)); } }
void DrawHud() { Gu.SetColor(Color.black); // draw score Gu.Label(Gu.Right(GameConsts.Hud.ScoreX), Gu.Top(GameConsts.Hud.ScoreY), Gu.Dim(GameConsts.Hud.ScoreFontSize), ((int)mDisplayedScore.Value).ToString("D5")); // draw % level complete int pc = Util.Clamp((int)(mLevelTime.NormalizedElapsed * 100), 0, 100); if (mGameState == GameState.Playing && pc == 100) { // while playing, we never get to 100% :-D pc = 99; } // draw level # and % complete Gu.Label(Gu.Left(GameConsts.Hud.StageX), Gu.Bottom(GameConsts.Hud.StageY), Gu.Dim(GameConsts.Hud.StageFontSize), string.Format(Strings.StageFmt, Util.GetLevelLetter(GameManager.Instance.Level), pc)); // draw accuracy Gu.Label(Gu.Right(GameConsts.Hud.AccuracyX), Gu.Top(GameConsts.Hud.AccuracyY), Gu.Dim(GameConsts.Hud.AccuracyFontSize), string.Format(Strings.AccuracyFmt, GetAccuracyPercent())); // draw combo counter if (mCombo > 1 && Util.BlinkFunc(GameConsts.BlinkPeriod, 0.0f)) { Gu.SetColor(GameConsts.Hud.ComboColor); Gu.Label(Gu.Center(GameConsts.Hud.ComboX), Gu.Top(GameConsts.Hud.ComboY), Gu.Dim(GameConsts.Hud.ComboFontSize), string.Format(Strings.ComboFmt, GetComboMult())); } // if there's a message being displayed, draw it now if (mMessageCd.Active && mMessage != null) { Gu.SetColor(0.0f, 0.0f, 0.0f, Util.Trapezoid(GameConsts.Hud.MessageDuration, GameConsts.Hud.MessageTransitionDuration, mMessageCd.Elapsed)); Gu.Label(Gu.Center(0), Gu.Middle(0), Gu.Dim(GameConsts.Hud.MessageFontSize), mMessage); } }
void OnGUI() { if (Time.timeScale == 0) { return; } if (DelayBeforeStart > 0) { return; } GUI.skin = GuiSkin; switch (phase) { case 0: float aspect = ArrowTex.width / (float)ArrowTex.height; GUI.DrawTexture(new Rect(Gu.Left(GameConsts.Tutorial.SteerArrowX), Gu.Top(0), aspect * Screen.height, (int)(mTransitionCd.NormalizedElapsed * Screen.height)), ArrowTex); Gu.Label( Gu.Left(GameConsts.Tutorial.SteerTextX), (int)Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Middle(0), mTransitionCd.NormalizedElapsed), Gu.Dim(GameConsts.Tutorial.FontSize), Strings.Tutorial1); break; case 1: Gu.Label(Gu.Right(GameConsts.Tutorial.FireTextX), (int)Util.Interpolate(0.0f, Screen.height, 1.0f, Gu.Middle(0), mTransitionCd.NormalizedElapsed), Gu.Dim(GameConsts.Tutorial.FontSize), Strings.Tutorial2); break; default: Gu.Label(Gu.Center(0), (int)(Util.Interpolate(0.0f, 0.0f, 1.0f, Gu.Middle(0), mTransitionCd.NormalizedElapsed)), Gu.Dim(GameConsts.Tutorial.FontSize), Strings.Tutorial3); break; } }
void DrawBackground() { GUI.DrawTexture(new Rect( Gu.Left(0), Gu.Top(0), Screen.width, Screen.height), BlackoutTexture); }
void DrawBuildString() { Gu.SetColor(Color.black); Gu.Label(Gu.Left(GameConsts.Menu.BuildStringX), Gu.Bottom(GameConsts.Menu.BuildStringY), Gu.Dim(GameConsts.Menu.BuildStringFontSize), Strings.BuildString, false); }