예제 #1
0
        public static void Next()
        {
            ++ScriptPosition;
            if (ScriptPosition <= ScriptLength)
            {
                ActionType = int.Parse(SQLEngine.GetValue("SELECT CmdID FROm ScnScript WHERE ID =" + ScriptPosition.ToString()));
                switch (ActionType)
                {
                case 1:
                    TryHard.This(() => SQLEngine.ImagePath());
                    GraphicEngine.SetBackground();
                    //MessageBox.Show(text: ScriptPosition.ToString());
                    break;

                case 2:
                    break;

                case 3:
                    break;
                }
            }

            else
            {
                MessageBox.Show(text: "End of Script.");
            }
        }
예제 #2
0
        private void GameWindow_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.Clear(Color.Transparent);
            GraphicEngine.DrawBackground(e);
            //GraphicEngine.DrawCharacter(this, 0, 0, 1.3m, 1.3m, e, @"G:\Temp\1.png", 1); //use 0 as width/heigth for default values , last value is Alpha (1 - non transparent, 0.25f etc trans)
            if (TextAreaVisible == true)
            {
                GraphicEngine.DrawTextarea(this, e, TextareaImage);
            }


            //MessageBox.Show(text: GraphicEngine.BackgroundImage.Width.ToString());
        }
 public static void SetBackground()
 {
     GraphicEngine.BackgroundImage.Dispose();
     GraphicEngine.BackgroundImage = GraphicEngine.BGimg(ScriptEngine.Path);
     if (UseDominantColor == true)
     {
         GraphicEngine.BackgroundColor = GameWindow.getDominantColor(GraphicEngine.BackgroundImage);
     }
     else
     {
         GraphicEngine.BackgroundColor = System.Drawing.Color.Black;
     }
 }
예제 #4
0
        public static void GameInit()
        {
            ActionType = int.Parse(SQLEngine.GetValue("SELECT CmdID FROm ScnScript WHERE ID =" + ScriptPosition.ToString()));
            switch (ActionType)
            {
            case 1:
                TryHard.This(() => SQLEngine.ImagePath());
                GraphicEngine.SetBackground();
                break;

            case 2:
                break;

            case 3:
                break;
            }
        }
예제 #5
0
        private void GameWindow_Load(object sender, EventArgs e)
        {
            //<--Maximize window
            this.WindowState     = FormWindowState.Normal;
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Bounds          = Screen.PrimaryScreen.Bounds;
            this.WindowState     = FormWindowState.Maximized;
            GraphicEngine.GetResolution(); //sets resolution for rendering
                                           //-->

            this.panelOptions.AllowDrop = true;
            foreach (Control c in this.panelOptions.Controls)
            {
                c.MouseDown += new MouseEventHandler(c_MouseDown);
            }
            this.panelOptions.DragOver += new DragEventHandler(panelOptions_DragOver);
            this.panelOptions.DragDrop += new DragEventHandler(panelOptions_DragDrop);

            //<--Resize/Move components according to resolution
            button1.Location = new Point(GraphicEngine.X(button1.Location.X), GraphicEngine.Y(button1.Location.Y));
            button1.Size     = new Size(GraphicEngine.X(button1.Size.Width), GraphicEngine.Y(button1.Size.Height));

            //-->

            //<--sets hidable Text are to visible state by default
            this.TextAreaVisible = true;
            //-->

            // this.LoadBackground(@"G:\Temp\Images\13.jpg");


            ScriptEngine.GameInit();
            int Value = int.Parse(SQLEngine.GetValue("Select Value from GameOptions where ID=1"));

            if (Value == 1)
            {
                checkBoxOptions_toggleDominantColor.Checked = true; GraphicEngine.UseDominantColor = true;
            }
            else
            {
                checkBoxOptions_toggleDominantColor.Checked = false; GraphicEngine.UseDominantColor = false;
            }
        }