Microsoft.Xna.Framework.Vector2.Negate C# (CSharp) Method

Negate() public static method

Returns a vector pointing in the opposite direction.
public static Negate ( Vector2 value ) : Vector2
value Vector2 Source vector.
return Vector2
        public static Vector2 Negate(Vector2 value)
        {
            Vector2 result;
            result.X = -value.X;
            result.Y = -value.Y;
            return result;
        }
        /// <summary>Returns a vector pointing in the opposite direction.</summary>

Same methods

Vector2::Negate ( Vector2 &value, Vector2 &result ) : void

Usage Example

コード例 #1
0
ファイル: InkGenerator.cs プロジェクト: akbiggs/Trauma
        public InkGenerator(Vector2 position, Vector2 blobDirection, Color color, int interval, float speed)
            : base(position, Vector2.Zero, Vector2.Zero, Vector2.Zero, Vector2.Zero, color, true, 
                Vector2.One, new List<AnimationSet>
                    {
                        new AnimationSet(DRIP, ResourceManager.GetTexture("Generator_Drip"), DRIP_NUM_FRAMES, 
                            DRIP_FRAME_WIDTH, FRAME_DURATION)
                    },
                DRIP, blobDirection.Negate().ToAngle())
        {
            reloadTimer = interval;
            this.interval = interval;

            this.blobDirection = blobDirection;
            blobSpeed = speed;
            blobColor = color;
        }