示例#1
0
        public void UpdateControls()
        {
            if (KEY.IsDown(Keys.Z) && KEY.LClick)
            {
                CollectObjects(KEY.IsDown(Keys.X), KEY.IsDown(Keys.C));
            }
            if (KEY.IsDown(Keys.LeftShift) && KEY.WheelUp)
            {
                if (CurrentDebugObject is GameObject)
                {
                    var a = (GameObject)CurrentDebugObject;
                    a.color = Color.White;
                }
                index++;
            }
            if (KEY.IsDown(Keys.LeftShift) && KEY.WheelDown)
            {
                if (CurrentDebugObject is GameObject)
                {
                    var a = (GameObject)CurrentDebugObject;
                    a.color = Color.White;
                }
                index--;
            }

            if (debugObjects.Count > 0)
            {
                if (index < 0)
                {
                    index = debugObjects.Count - 1;
                }
                index %= debugObjects.Count;
                CurrentDebugObject = debugObjects[index];
            }
            if (CurrentDebugObject is GameObject)
            {
                var go = (GameObject)CurrentDebugObject;
                go.color = Color.Yellow;
            }

            if (KEY.IsDown(Keys.LeftControl) && KEY.LClick)
            {
                power *= 10;
            }
            if (KEY.IsDown(Keys.LeftControl) && KEY.RClick)
            {
                power /= 10;
            }
        }
示例#2
0
        public override void Update()
        {
            if (KEY.IsDown(Keys.U) && KEY.LClick)
            {
                TurnOn();
            }
            if (KEY.IsDown(Keys.U) && KEY.RClick)
            {
                TurnOff();
            }

            UpdateControls();
            UpdateParam();
            EditParam();
            UpdateInfo();
        }
示例#3
0
        public void UpdateParam()
        {
            if (KEY.IsDown(Keys.LeftShift))
            {
                if (KEY.IsDown(Keys.X))
                {
                    currentParam = param.X;
                }
                if (KEY.IsDown(Keys.Y))
                {
                    currentParam = param.Y;
                }
                if (KEY.IsDown(Keys.W))
                {
                    currentParam = param.W;
                }
                if (KEY.IsDown(Keys.H))
                {
                    currentParam = param.H;
                }

                if (KEY.IsDown(Keys.A))
                {
                    currentParam = param.Alpha;
                }
                if (KEY.IsDown(Keys.R))
                {
                    currentParam = param.Rot;
                }
                if (KEY.IsDown(Keys.F))
                {
                    currentParam = param.Frame;
                }

                if (KEY.IsDown(Keys.S))
                {
                    currentParam = param.S;
                }
                if (KEY.IsDown(Keys.D))
                {
                    currentParam = param.SW;
                }
                if (KEY.IsDown(Keys.E))
                {
                    currentParam = param.SH;
                }

                if (KEY.IsDown(Keys.Space))
                {
                    if (KEY.IsDown(Keys.X))
                    {
                        currentParam = param.RX;
                    }
                    if (KEY.IsDown(Keys.Y))
                    {
                        currentParam = param.RY;
                    }

                    if (KEY.IsDown(Keys.A))
                    {
                        currentParam = param.RAlpha;
                    }

                    if (KEY.IsDown(Keys.S))
                    {
                        currentParam = param.RS;
                    }
                    if (KEY.IsDown(Keys.D))
                    {
                        currentParam = param.RSW;
                    }
                    if (KEY.IsDown(Keys.E))
                    {
                        currentParam = param.RSH;
                    }
                }
            }
        }
示例#4
0
        public void EditParam()
        {
            double pow = 0;

            if (KEY.WheelUp)
            {
                pow = power;
            }
            if (KEY.WheelDown)
            {
                pow = -power;
            }

            if (pow != 0)
            {
                if (KEY.IsDown(Keys.LeftControl))
                {
                    if (CurrentDebugObject is GameObject)
                    {
                        var go = (GameObject)CurrentDebugObject;

                        switch (currentParam)
                        {
                        case param.X:
                            go.X += pow;
                            break;

                        case param.Y:
                            go.Y += pow;
                            break;

                        case param.W:
                            go.W += pow;
                            break;

                        case param.H:
                            go.H += pow;
                            break;

                        case param.SW:
                            go.ScaleW += pow;
                            break;

                        case param.SH:
                            go.ScaleH += pow;
                            break;

                        case param.S:
                            go.ScaleW += pow;
                            go.ScaleH += pow;
                            break;

                        case param.Alpha:
                            go.Alpha += pow;
                            break;

                        case param.Rot:
                            go.Rotation += pow;
                            break;

                        case param.Frame:
                            if (pow < 1)
                            {
                                go.Stop();
                                go.PrevFrame();
                            }
                            else
                            {
                                go.Stop();
                                go.NextFrame();
                            }
                            break;
                        }
                    }

                    switch (currentParam)
                    {
                    case param.RX:
                        CurrentDebugObject.BaseRenderParameters.X += pow;
                        break;

                    case param.RY:
                        CurrentDebugObject.BaseRenderParameters.Y += pow;
                        break;

                    case param.RSW:
                        CurrentDebugObject.BaseRenderParameters.ScaleW += pow;
                        break;

                    case param.RSH:
                        CurrentDebugObject.BaseRenderParameters.ScaleH += pow;
                        break;

                    case param.RS:
                        CurrentDebugObject.BaseRenderParameters.ScaleW += pow;
                        CurrentDebugObject.BaseRenderParameters.ScaleH += pow;
                        break;

                    case param.RAlpha:
                        CurrentDebugObject.BaseRenderParameters.Alpha += pow;
                        break;
                    }
                }
            }
        }