예제 #1
0
 public BoundSizeControl(double zoom, double width, double height, double widthInf = 0.02, double widthSup = 0.3, double heightInf = 0.02, double heightSup = 0.3)
 {
     _startZoom = zoom;
     _sizeInf   = new BoundSize()
     {
         Width = widthInf, Height = heightInf
     };
     _sizeSup = new BoundSize()
     {
         Width = widthSup, Height = heightSup
     };
     _startSize = new BoundSize()
     {
         Width = width, Height = height
     };
     _zoom = _startZoom;
     setSizeByLimits(ref _startSize);
 }
예제 #2
0
 private void setSizeByLimits(ref BoundSize size)
 {
     setWidthByLimits(ref size.Width);
     setHeightByLimits(ref size.Height);
 }
예제 #3
0
 private void resetBoundSize()
 {
     _startSize = Size;
     _startZoom = _zoom;
 }
예제 #4
0
 public void Draw(Point position, GraphicsData GraphicsData)
 {
     Bound = new Rectangle(position, BoundSize);
     GraphicsData.SpriteBatch.DrawRectangle(position.ToVector2(), BoundSize.ToVector2(), BoundColor);
     GraphicsData.SpriteBatch.DrawString(MessageFont, MessageText, position.ToVector2() + new Vector2(Padding), TextColor);
 }