예제 #1
0
        void Process()
        {
            if (waitForClick || fadeMidAction != null)
            {
                return;
            }

            if (nextActionTicks > ticks)
            {
                Scroll();
                return;
            }

            if (actionIndex == actions.Count)
            {
                Active = false;
                finishAction?.Invoke();
                return;
            }

            var action = actions[actionIndex];

            switch (action.Command)
            {
            case OutroCommand.ChangePicture:
            {
                Fade(() =>
                    {
                        texts.ForEach(text => text.Destroy());
                        texts.Clear();
                        var graphicInfo            = graphicInfos[action.ImageOffset.Value];
                        picture.PaletteIndex       = (byte)(paletteOffset + graphicInfo.PaletteIndex);
                        picture.TextureAtlasOffset = textureAtlas.GetOffset(graphicInfo.GraphicIndex);
                        picture.Resize(graphicInfo.Width, graphicInfo.Height);
                        picture.X       = (Global.VirtualScreenWidth - graphicInfo.Width) / 2;
                        picture.Y       = (Global.VirtualScreenHeight - graphicInfo.Height) / 2;
                        picture.Visible = true;
                        ++actionIndex;
                    });
                break;
            }

            case OutroCommand.WaitForClick:
            {
                ++actionIndex;
                waitForClick = true;
                break;
            }

            case OutroCommand.PrintTextAndScroll:
            {
                if (action.TextIndex != null)
                {
                    PrintText(action.TextDisplayX, outroData.Texts[action.TextIndex.Value], action.LargeText);
                }
                double pixelsPerTick = PixelScrollPerSecond[speedIndex] / Game.TicksPerSecond;
                long   scrollTicks   = (long)Math.Round(action.ScrollAmount / pixelsPerTick);
                ++actionIndex;
                scrolledAmount   = 0;
                scrollStartTicks = ticks;
                nextActionTicks  = ticks + scrollTicks;
                break;
            }
            }
        }
예제 #2
0
        protected override void Layout()
        {
            base.Layout();

            sprite.Resize(Width, Height);
        }