public SHGUIprogressbar SetBlinkingLabel(string label, float blinkTime)
    {
        if (labelView != null)
        {
            labelView.KillInstant();
        }

        SHGUIview top = AddSubView(new SHGUIview());
        SHGUIview b   = top.AddSubView(new SHGUIblinkview(blinkTime));

        b.AddSubView(new SHGUItext(label, (int)((length + 2) / 2 - label.Length / 2) + 1, 0, 'w'));

        labelView = top;

        return(this);
    }
Exemple #2
0
    public void Dismiss()
    {
        if (!restrictDismissing)
        {
            Kill();
            for (int i = 0; i < queueSkips; ++i)
            {
                SHGUIview v = SHGUI.current.PopViewFromQueue();
                if (v != null)
                {
                    v.KillInstant();
                }
            }
        }
        else
        {
            char c = 'w';
            if (restrictInstruction != null)
            {
                restrictInstruction.KillInstant();
                c = 'w';
            }

            if (color == 'r')
            {
                c = 'r';
            }
            restrictInstruction = null;

            string text = restrictedInstructions[UnityEngine.Random.Range(0, restrictedInstructions.Count)];
            restrictInstruction = new SHGUItempview(1f);

            restrictInstruction.AddSubView(new SHGUItext(text, instructionX, instructionY, c).GoFromRight());

            AddSubView(restrictInstruction);

            PunchIn(.8f);

            restrictInstruction.PunchIn(0f);

            SHGUI.current.PlaySound(SHGUIsound.noescape);
        }
    }
Exemple #3
0
    void DrawScore()
    {
        if (smallScore != null)
        {
            smallScore.y = 6 - guiHideOffset;
        }

        if (alive)
        {
            if (score == lastdisplayedscore)
            {
                return;
            }

            if (smallScore != null)
            {
                smallScore.KillInstant();
            }

            smallScore = null;
            smallScore = new SHGUIview();
            smallScore.overrideFadeInSpeed = 4f;
            string s = (score) + "";
            if (s.Length == 2)
            {
                s = s[0] + " " + s[1];
            }
            if (s.Length == 4)
            {
                s = s[0] + "" + s[1] + " " + s[2] + "" + s[3];
            }
            smallScoreContent = new SHGUItext(s, 0 - (int)(s.Length / 2), 0, 'w');
            smallScore.x      = 32;
            smallScore.y      = 6 - guiHideOffset;
            smallScore.AddSubView(new SHGUIrect(-(int)(s.Length / 2) - 2, -1, (int)(s.Length / 2) + 2, 1, 'z'));
            smallScore.AddSubView(new SHGUIframe(-(int)(s.Length / 2) - 2, -1, (int)(s.Length / 2) + 2, 1, 'z'));

            smallScore.AddSubView(smallScoreContent);

            AddSubView(smallScore);

            lastdisplayedscore = score;
        }
        else
        {
            if (bigScore == null && guiHideOffset == 40)
            {
                bigScore = new SHGUIview();
                AddSubView(bigScore);

                //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont(score + ""), 10, 11, 'x'));
                //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont("DUDE DEAD"), 10, 3, 'w'));
                SHGUIsprite s1 = new SHGUIsprite();
                s1.x = 10;
                s1.y = 2;
                s1.animationSpeed = .75f;
                s1.loops          = true;
                APPtreedudeintro.TreeDudeSequence(s1, "D%T%");
                bigScore.AddSubView(s1);

                SHGUIsprite s2 = new SHGUIsprite();
                s2.x              = 35;
                s2.y              = 2;
                s2.loops          = true;
                s2.animationSpeed = .75f;
                APPtreedudeintro.TreeDudeSequence(s2, "%DDD");
                bigScore.AddSubView(s2);


                //score += 990;
                int len = (6 + score.ToString().Length) * 6 - 1;
                int off = (((score.ToString().Length % 2) == 0)?(1):(0));
                bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont("SCORE " + score), 34 - (int)(len / 2) + off, 9, 'w'));
                //bigScore.AddSubView(new SHGUItext(SHGUI.current.GetASCIIartFromFont(score + ""), 10, 15, 'w'));

                string ttt = "--PERSONAL-BEST-" + personalBest + "--";
                if (score > personalBest)
                {
                    personalBest = score;
                    ttt          = "--NEW-PERSONAL-BEST!-";
                }

                SHGUIview v = new SHGUIview();

                v.AddSubView(new SHGUItext(ttt, 32 - (int)(ttt.Length / 2) - 1, 15, 'w'));
                bigScore.AddSubView(v);

                SHGUIview v2   = new SHGUIblinkview(.75f);
                string    ttt2 = "[PRESS ENTER TO RESTART]";
                v2.AddSubView(new SHGUIrect(32 - (int)(ttt2.Length / 2), 20, 32 + (int)(ttt2.Length / 2) - 1, 20));
                v2.AddSubView(new SHGUItext(ttt2, 32 - (int)(ttt2.Length / 2), 20, 'w'));
                bigScore.AddSubView(v2);
            }
        }
    }