Exemplo n.º 1
0
        public override void Update()
        {
            UpdateBegin();

            if (visible)
            {
                btn.Update();

                if (btn.pressed)
                {
                    if (Input.mbLeft.pressed)
                    {
                        Vector2 g = customGrid();
                        p1        = (Vector2.Transform(Input.mbPos, Matrix.Invert(viewTransform())) / g).RoundVector() * g;
                        rect.pos  = p1;
                        rect.size = Vector2.Zero;
                        isPosSet  = true;
                    }
                    else if (isPosSet)
                    {
                        if (Input.mbLeft.down)
                        {
                            Vector2 g  = customGrid();
                            Vector2 p2 = (Vector2.Transform(Input.mbPos, Matrix.Invert(viewTransform())) / g).RoundVector() * g;

                            if (positiveSize)
                            {
                                rect.size = (p2 - p1).AbsVector();
                                rect.pos  = Calculate.MinVector(p1, p2);
                            }
                            else
                            {
                                rect.size = p2 - p1;
                            }

                            txt.text = MyConverter.ToString(rect);
                        }
                        else if (Input.mbLeft.released)
                        {
                            btn.pressed = false;
                            isPosSet    = false;
                            SetCatchUpdate(null);

                            if (ValueChanged != null)
                            {
                                ValueChanged(rect);
                            }
                        }
                    }
                }
                else
                {
                    txt.Update();
                    isPosSet = false;
                }
            }
        }
Exemplo n.º 2
0
        public override void Update()
        {
            if (visible)
            {
                UpdateBegin();

                btn.Update();
                txt.Update();
            }
        }
Exemplo n.º 3
0
        public override void Update()
        {
            if (visible)
            {
                UpdateBegin();

                btn_Text.Update();
                btn_Arrow.Update();

                if (btn_Arrow.pressed)
                {
                    for (int i = 0; i < btn_Enums.Count; i++)
                    {
                        btn_Enums[i].Update();
                    }
                }

                if (Input.mbLeft.pressed && btn_Arrow.pressed)
                {
                    CloseList();
                }
            }
        }