Beispiel #1
0
 protected override void Draw(GameTime gameTime)
 {
     StandAlone.ElapsedMillisec = gameTime.ElapsedGameTime.Milliseconds;
     Game1.Painter.ClearBackground(Color.Black);
     Projectors.Draw();
     StandAlone.InternalDraw();
     CustomDraw();
     base.Draw(gameTime);
 }
Beispiel #2
0
        protected override void Update(GameTime gameTime)
        {
            if (GameExit)
            {
                Exit();
            }

            Projectors.Update();
            StandAlone.InternalUpdate();
            CustomUpdate();
            User.Update();
            base.Update(gameTime);
        }
Beispiel #3
0
        /// <summary>
        /// 리스트 아이템 중 한개를 랜덤하게 픽합니다.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="Ts"></param>
        /// <returns></returns>
        public static T RandomPick <T>(List <T> Ts)
        {
            double r = StandAlone.Random();
            double m = 1.0 / Ts.Count;

            for (int i = 0; i < Ts.Count; i++)
            {
                if (r >= m * i && r < m * (i + 1))
                {
                    return(Ts[i]);
                }
            }
            return(Ts[0]);
        }
Beispiel #4
0
        public DialogLoader(int fontsize, REMOPoint Name_Pos, REMOPoint Dialog_Pos, Color StringColor, Color BackgroundColor)
        {
            ScriptReader.AddRule("CG", (s) =>
            {
                CGPipeline[s].Draw();
            });
            ScriptReader.AddRule("n", (s) => { StandAlone.DrawString(fontsize, "KoreanFont", s, Name_Pos, StringColor); });
            ScriptReader.AddRule("s", (s) => {
                s = s.Replace("@", "\n");
                if (currentString.Length < s.Length && StandAlone.FrameTimer % 4 == 0)
                {
                    currentString = s.Substring(0, currentString.Length + 1);
                }
                StandAlone.DrawString(fontsize, "KoreanFont", currentString, Dialog_Pos, StringColor);
            });

            scn = new Scene(() =>
            {
                line = 0;
            }, () =>
            {
                if (User.JustPressed(Keys.Z) || User.JustPressed(Keys.Space) || User.JustLeftClicked())
                {
                    string currentScript = ScriptReader.ParseLine("s", Scripts[line]);
                    currentScript        = currentScript.Replace("@", "\n");
                    if (currentString.Length == currentScript.Length)
                    {
                        line++;                     //다음 라인으로 넘어갑니다.
                        currentString = "";
                        if (line == Scripts.Length) //스크립트를 다 읽었을 경우, 지정해둔 액션으로 넘어갑니다.
                        {
                            Projectors.Projector.Unload(scn);
                            AfterAction();
                        }
                    }
                    else
                    {
                        currentString = currentScript;
                    }
                }
            }, () =>
            {
                Filter.Absolute(StandAlone.FullScreen, BackgroundColor);
                ScriptReader.ReadLine(Scripts[line]);
                Cursor.Draw(Color.White);
            });
        }
Beispiel #5
0
 public CustomTLReader() : base()
 {
     this.Embracer = "[]";
     this.AddRule("Script", (s) => { StandAlone.DrawString(s, new Point(100, 200), Color.White); });
 }
Beispiel #6
0
 public void Draw(Color c)
 {
     StandAlone.DrawString(FuncCallCount + " Loop,Time = " + StandAlone.ElapsedMillisec + "ms (per 1frame)", REMOPoint.Zero, c);
 }