Exemple #1
0
            public SPoint Down(SPoint Point_) // return : Vector
            {
                if (CBase.Distance(_Center, Point_) > _InputRadius)
                {
                    return(null);
                }

                _Enabled = true;

                return(Move(Point_));
            }
Exemple #2
0
            public SPoint Move(SPoint Point_) // return : Vector
            {
                if (!_Enabled)
                {
                    return(null);
                }

                _Vector.X = Point_.X - _Center.X;
                _Vector.Y = Point_.Y - _Center.Y;

                var Distance = CBase.Distance(_Center, Point_);

                if (Distance > _EffectiveRadius)
                {
                    var Ratio = _EffectiveRadius / Distance;
                    _Vector.X *= Ratio;
                    _Vector.Y *= Ratio;
                }

                return(_Vector);
            }