public override void Update(float frameTime) { background.Position = Position; //_targetArea.Position = new Point(Position.X + 5, Position.Y + 5); _targetArea.Position = new Point(Position.X + (int)(ClientArea.Width / 2f) - (int)(_targetArea.ClientArea.Width / 2f), Position.Y + 15); _targetArea.Update(0); ClientArea = new Rectangle(Position.X, Position.Y, (int)background.Width, (int)background.Height); }
public override void Update(float frameTime) { background.Position = new SFML.System.Vector2f(Position.X, Position.Y); //_targetArea.Position = new Vector2i(Position.X + 5, Position.Y + 5); _targetArea.Position = new Vector2i(Position.X + (int)(ClientArea.Width / 2f) - (int)(_targetArea.ClientArea.Width / 2f), Position.Y + 15); _targetArea.Update(0); var bounds = background.GetLocalBounds(); ClientArea = new IntRect(Position.X, Position.Y, (int)bounds.Width, (int)bounds.Height); }