Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
 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));
 }
Exemplo n.º 4
0
 public void EnableCursorBounds(RectangleF bounds)
 {
     cursorBoundsEnabled = true;
     this.cursorBounds = bounds;
 }