コード例 #1
0
        private void NextScene()
        {
            //запускаем следующую сцену
            SceneNumber++;
            if (SceneNumber >= Scenes.Count)
            {
                SceneNumber = 0;
            }

            if (Scenes[SceneNumber].DrawTimeout <= 0)
            {
                tmrDraw.Interval = DefaultDrawTimeout;
            }
            else
            {
                tmrDraw.Interval = Scenes[SceneNumber].DrawTimeout;
            }

            back_color = Scenes[SceneNumber].BackColor;

            teky = starty;

            if (SceneChanged != null)
            {
                SceneChangedEventArgs evarg = new SceneChangedEventArgs();
                evarg.BackColor   = back_color;
                evarg.SceneNumber = SceneNumber;
                SceneChanged(this, evarg);
            }
        }
コード例 #2
0
        public bool StartDraw()
        {
            if (!ScriptLoaded)
            {
                ErrorMessage = "Script not loaded.";
                return(false);
            }

            starty  = teky = pctDraw.Height;
            endy    = pctDraw.Location.Y;
            centery = starty / 2;

            if (Scenes.Count < 1)
            {
                ErrorMessage = "No scenes.";
                return(false);
            }

            if (Scenes[0].DrawTimeout <= 0)
            {
                tmrDraw.Interval = DefaultDrawTimeout;
            }
            else
            {
                tmrDraw.Interval = Scenes[0].DrawTimeout;
            }

            back_color  = Scenes[0].BackColor;
            SceneNumber = 0;
            if (SceneChanged != null)
            {
                SceneChangedEventArgs evarg = new SceneChangedEventArgs();
                evarg.BackColor   = back_color;
                evarg.SceneNumber = SceneNumber;
                SceneChanged(this, evarg);
            }


            tmrDraw.Start();

            return(true);
        }