/// <summary> /// Enables camera bounds, so that the camera never leaves these bounds. /// </summary> /// <param name="bounds">The bounds for the camera.</param> public void EnableBounds(RectangleF bounds) { edgeBounds = bounds; centerBounds = bounds.Inflate(-Dimensions.X / 2, -Dimensions.Y / 2); applyBounds = true; }
public override void Update(InputController inputController) { //process input ProcessInput(inputController); //update options and cursor IntValue = arrangement.GetIndex(x, y); for (int i = 0; i < options.Count; i++) options[i].Update(i == IntValue); cursor.Update(IntValue); if (cursorBoundsEnabled)// && !cursorBounds.Contains(cursor.Position)) { //offset = -cursorBounds.EdgeDistance(cursor.Position); cursorBounds = cursorBounds.Offset(cursorBounds.EdgeDistance(cursor.Position)); } }
public RectangleF Envelope(RectangleF other) { return new RectangleF(Math.Min(Left, other.Left), Math.Max(Right, other.Right), Math.Min(Top, other.Top), Math.Max(Bottom, other.Bottom)); }
public void EnableCursorBounds(RectangleF bounds) { cursorBoundsEnabled = true; this.cursorBounds = bounds; }