Пример #1
0
 public SubtitleText Show(int priority, SubtitleText st)
 {
     q.Add(new QueuedText(priority, st));
     st.Active = false;
     Add(st);
     return(st);
 }
Пример #2
0
 protected void ShowToyMsg(string text, float duration)
 {
     if (currentToyMsg != null)
     {
         currentToyMsg.Delete = true;
     }
     currentToyMsg = Level.Current.Subtitles.Show(1, text, duration);
 }
        public void AddText(string txt, float duration)
        {
            SubtitleText st = new SubtitleText(txt);

            st.Duration  = duration - 0.1f;
            st.StartTime = nextTextStartTime;
            AddNextUpdate(st);
            nextTextStartTime += duration;
            Duration           = nextTextStartTime;
        }
Пример #4
0
        public SubtitleText Show(int priority, string txt, float duration, Color color)
        {
            SubtitleText st = new SubtitleText(txt);

            st.DrawInfo.DrawColor = color;
            st.Duration           = duration;
            q.Add(new QueuedText(priority, st));
            st.Active = false;
            Add(st);
            return(st);
        }
Пример #5
0
        public Level() : base()
        {
            Current = this; // pointer to level instance singleton

            // create level's objects. These will be added as a child later.
            MotionB    = new MotionBehavior();
            Subtitles  = new SubtitleManager();
            StatusText = new SubtitleText();
            HelpScroll = new TimedSpritelet("help-scroll.png");
            //debugMsg = new DebugMessage();
        }
Пример #6
0
        public TitleScreen()
        {
            bg = new RotatingBackground("psych");
            bg.Motion.Scale = 20.0f;
            bg.StartTime    = 0f;// 9.09f;
            Add(bg);

            pixie = new Pixie();
            pixie.Motion.Position = new Vector2(0.666f, 0.0f);
            pixie.Motion.Scale    = 20.0f;
            pixie.Duration        = TIME_LOGO_APPEAR;
            Add(pixie);

            cuteText = new SubtitleText(new string[] { "She's pink...", "   She's cute...", "      She's all square!" },
                                        new float[] { 1.5f, 3.5f, 5.5f },
                                        false);
            cuteText.Motion.Position = new Vector2(0.26f, 0.62f);
            cuteText.Duration        = TIME_LOGO_APPEAR;
            Add(cuteText);

            /*
             * helpText = new SubtitleText("SPACE  Play!\n  C         Credits\n ESC       Exit");
             * helpText.StartTime = 13.5f;
             * helpText.Motion.Scale = 0.7f;
             * helpText.DrawInfo.DrawColor = Color.AntiqueWhite;
             * helpText.Motion.Position = new Vector2(0.2f, 0.6f);
             * Add(helpText);
             */
            helpText                 = new Spritelet("showControls");
            helpText.StartTime       = TIME_LOGO_APPEAR;
            helpText.Motion.Scale    = 1f;
            helpText.Motion.Position = new Vector2(0.666f, 0.85f);
            Add(helpText);


            pixieLogo = new PixieLogo("pixielogo");
            pixieLogo.Motion.Scale    = 20.0f;
            pixieLogo.Motion.Position = new Vector2(0.666f, 0.35f);
            pixieLogo.StartTime       = TIME_LOGO_APPEAR;
            Add(pixieLogo);

            MotionB = new MotionBehavior();
            Add(MotionB);

            creditsScreen = new Thing("credits.png");
            Add(creditsScreen);
            creditsScreen.Visible = false;

            /*
             * ttLogo = new Spritelet("tt-logo-4");
             * ttLogo.Motion.Position = new Vector2(1.05f, 0.02f);
             * Add(ttLogo);
             */
        }
Пример #7
0
 public void FoundPinkArthur()
 {
     if (!hasFoundPinkArthur)
     {
         hasFoundPinkArthur = true;
         SubtitleText t = new SubtitleText();
         t.AddText("My King! Here you are.", 4f);
         t.AddText("We have come, to rescue thee.", 4f);
         t.AddText("Follow me, out of this\ncursed place.", 7f);
         Subtitles.Show(8, t);
     }
 }
Пример #8
0
        protected override void OnUpdate(ref UpdateParams p)
        {
            base.OnUpdate(ref p);
            if (IsUsed)
            {
                UseTime += p.Dt;
            }
            if (UseTime > UseTimeMax)
            {
                StopUsing();
            }

            // check if the last message, if any, about this toy is already done and new instance can be started
            Thing pixie          = Level.Current.hero;
            bool  pixieFacingToy = CollidesWhenOtherMoves(pixie, pixie.FacingDirection);

            if (toyExplanationMessage != null && toyExplanationMessage.Delete && !pixieFacingToy)
            {
                toyExplanationMessage = null;
            }

            // pixie facing this Toy == print info message
            if (ParentThing == null && toyExplanationMessage == null && pixieFacingToy)
            {
                var nm = SayToyName();
                toyExplanationMessage = Level.Current.Subtitles.Show(5, nm, 2.1f + 0.07f * nm.Length);
            }

            // collision with pixie = pickup
            if (ParentThing == null && Collides(pixie))
            {
                Level.Current.Sound.PlayPickupSound();
                if (CanBePickedUp)
                {
                    pixie.Add(this);
                    Visible = false;
                }
                else
                {
                    if (UsesLeft > 0)
                    {
                        StartUsing();
                    }
                }
            }
        }
Пример #9
0
        public SubtitleText AddText(string txt, float duration)
        {
            if (nextTextStartTime < SimTime)
            {
                nextTextStartTime = SimTime; // ensure titles not started in the past
            }
            SubtitleText st = new SubtitleText(txt);

            st.IsAutoPosition     = this.IsAutoPosition;
            st.ShadowVector       = this.ShadowVector;
            st.SubtitleFont       = this.SubtitleFont;
            st.Shadow             = this.Shadow;
            st.Duration           = duration - 0.1f;
            st.StartTime          = nextTextStartTime;
            st.DrawInfo.DrawColor = this.DrawInfo.DrawColor;
            AddNextUpdate(st);
            nextTextStartTime += duration;
            Duration           = nextTextStartTime;
            return(st);
        }
Пример #10
0
        public virtual void LoseLevel()
        {
            this.Subtitles.Children.Clear(); // clean out any remaining subtitles being shown.
            SubtitleText t = new SubtitleText();

            t.AddText("BADLY WOUNDED, YOU DIE.", 7f);
            t.AddText("Galad the Golden is no more.", 7f);
            t.AddText("Pink Arthur remains captive\nfor all his life.", 7f);
            t.AddText("** THE END **", 7f);
            Subtitles.Show(9, t);
            isBackgroundScrollingOn = false; // stop the scrolling of the level around hero

            t                 = new SubtitleText();
            t.ScaleVector     = new Vector2(1f, 1f);
            t.ShadowVector    = new Vector2(1f, 1f);
            t.Motion.Scale    = 0.5f;
            t.Motion.Position = new Vector2(Screen.Center.X, 0.08f);
            t.StartTime       = this.SimTime + 28.5f;
            t.AddText("Coding & art by Indiegame Garden 2012-2015", 7f);
            Parent.AddNextUpdate(t);
        }
Пример #11
0
        public FinalScreen()
        {
            finalText = new SubtitleText(TXT, TXT_TIMINGS, false);
            finalText.SubtitleFont    = TTengineMaster.ActiveGame.Content.Load <SpriteFont>("m06_quadra");
            finalText.Motion.Position = new Vector2(0.1f, 0.32f);
            finalText.ScaleVector     = new Vector2(1f, 1f);
            finalText.Shadow          = false;
            Add(finalText);

            pixieLogo = new PixieLogo("finallogo");
            Add(pixieLogo);
            pixieLogo.Motion.Scale = 1f;
            //pixieLogo.bg.Motion.Scale = 2f;
            pixieLogo.Motion.Position = new Vector2(0.666f, 0.1f);
            pixieLogo.StartTime       = 0f;

            bg = new RotatingBackground("psych");
            bg.Motion.Scale = 20.0f;
            Add(bg);

            this.Duration = 74f;
        }
Пример #12
0
        public void WinLevel()
        {
            if (!hasWon)
            {
                float        playTime = (float)Math.Round(SimTime);
                SubtitleText t        = new SubtitleText();
                t.AddText("My King! WE WON!!", 5f).DrawInfo.DrawColor                 = Color.DarkGoldenrod;
                t.AddText("(Arthur:) I am home, at last.", 4f).DrawInfo.DrawColor     = PINK_COLOR;
                t.AddText("A reward, Galad,\nawaits thee...", 5f).DrawInfo.DrawColor  = PINK_COLOR;
                t.AddText("...in the Garden of Golden Chain!", 6f).DrawInfo.DrawColor = PINK_COLOR;
                t.AddText("", 1f);
                t.AddText("(Bard:) And so Arthur ruled for\nmany more prosperous years.", 4f);
                t.AddText("His Knights of the Square Table didth\ncommit a many legendary deeds.", 6f);
                t.AddText("", 2f);
                t.AddText("** THE END **", 4f);
                t.AddText("(Rescue time: " + playTime + " heart-beats.)", 15f);
                t.AddText("** THE END **", 4f);
                Subtitles.Show(6, t);
                hasWon = true;

                // level changes o so slightly
                Background.OverlayTexture("Garden1.png");
            }
        }
Пример #13
0
 public QueuedText(int priority, SubtitleText text)
 {
     this.Priority = priority;
     this.Text     = text;
 }