MegaMan.Engine.PositionComponent.Offset C# (CSharp) Method

Offset() public method

public Offset ( float x, float y ) : void
x float
y float
return void
        public void Offset(float x, float y)
        {
            Position = new PointF(Position.X + x, Position.Y + y);
        }

Usage Example

Example #1
0
        protected virtual void Finish(PositionComponent playerPos)
        {
            if (direction == Direction.Right)
            {
                playerPos.SetX(OffsetDist());
                playerPos.Offset(0, NextScreenY);
            }
            else if (direction == Direction.Left)
            {
                playerPos.SetX(nextWidth - OffsetDist());
                playerPos.Offset(0, NextScreenY);
            }
            else if (direction == Direction.Down)
            {
                playerPos.SetY(OffsetDist());
                playerPos.Offset(NextScreenX, 0);
            }
            else if (direction == Direction.Up)
            {
                playerPos.SetY(nextHeight - OffsetDist());
                playerPos.Offset(NextScreenX, 0);
            }

            if (ScrollDone != null)
            {
                ScrollDone(this);
            }
        }
All Usage Examples Of MegaMan.Engine.PositionComponent::Offset